Saving the teechart with all the information that was set

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
HitachiSteema
Newbie
Newbie
Posts: 13
Joined: Mon Aug 09, 2010 12:00 am
Contact:

Saving the teechart with all the information that was set

Post by HitachiSteema » Tue Oct 19, 2010 11:42 pm

Hi,

I draw the tee chart say for example the bar chart, with the values that was read from the data base.After displaying the bar chart, I may go to other links to view the other set of chart(lines chart, etc) that were drawn with different set of data base values. If I come back the first(barchart) page I need to see the barchart WHICH SHOULD BE SAVED in someeasy format.Instead what is currently done is, saving the data base values in the cache/static variable in c# and then making use of these varibales to draw the barchart again. Initially its is looking fine to me but my data base has huge set of tables and each tables has almost ~50 columns. I cant keep using static/cache variables for each column for each table.

Does tee chart support any kind of magic for saving the charts after drawing it in first instance and later retrieving back the saved charts during every other visit?

Thanks, Venu

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Saving the teechart with all the information that was set

Post by Narcís » Wed Oct 20, 2010 7:15 am

Hi Venu,

Yes, TeeChart includes native template files (*.ten) which can be exported and imported. You'll find more information about this at the impoting/exporting tutorial. Tutorials are available at TeeChart's program group.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

HitachiSteema
Newbie
Newbie
Posts: 13
Joined: Mon Aug 09, 2010 12:00 am
Contact:

Re: Saving the teechart with all the information that was set

Post by HitachiSteema » Tue Nov 16, 2010 11:47 pm

Hi,

I have a tchart with 5 bar series stacked. all the 5 series is shown in the legend box. if I uncheck first legend item the first bar series should not display and remaining series(2,3,4,5) should display. Next if I uncheck the fourth series in the legend the fourth series should go off, now displaying only 2,3,5.

Currently its not working as mentioned above. Instead its works as follows

1. all 5 series name in the legend box is selected - all 5 bar series is displayed
2. uncheck the 1st series name in the legend - 2,3,4,5 bar series is displayed
3. uncheck the 4th series name in the legend - 1,2,3,5 bar series is displayed( the first uncheck is checked back again)

I created all the bar series in the design time.

How to resolve it? My tee chart version is 4.0

Thanks,Venu

HitachiSteema
Newbie
Newbie
Posts: 13
Joined: Mon Aug 09, 2010 12:00 am
Contact:

Re: Saving the teechart with all the information that was set

Post by HitachiSteema » Tue Nov 16, 2010 11:49 pm

Hi,

I forgot to mention that I am working on .net version of tee chart on web page.

thanks

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Saving the teechart with all the information that was set

Post by Sandra » Wed Nov 17, 2010 11:43 am

Hello HitachiSteema,

I could reproduce your problem, and I have informed that it is known bug (TW77012763). I have increased its priority so try to fix it for next versions of TeeChart.Net.
On the other hand, I found a workaround, that you can use for solves problem with legend checkboxes, for now.

Code: Select all

public static System.IO.MemoryStream tmpChart;
    private static int index = -1;
    private static bool flag = true;
    private static System.Collections.ArrayList checkedSeries;

    protected void Page_Load(object sender, EventArgs e)
    {
        Steema.TeeChart.Chart ch1;
        if (flag)
        {
            ch1 = WebChart1.Chart;
            ch1.Legend.CheckBoxes = true;
            ch1.Series.Add(new Steema.TeeChart.Styles.Line());
            ch1.Series.Add(new Steema.TeeChart.Styles.Line());
            ch1.Series.Add(new Steema.TeeChart.Styles.Line());
            ch1.Series.Add(new Steema.TeeChart.Styles.Line());
            checkedSeries = new System.Collections.ArrayList();
            for (int i = 0; i < ch1.Series.Count; ++i)
            {
                ch1[i].FillSampleValues();
                CheckedSeries chk = new CheckedSeries(ch1[i].Active, i);
                checkedSeries.Add(chk);

            }
            tmpChart = new System.IO.MemoryStream();
            ch1.Export.Template.Save(tmpChart);
            WebChart1.ClickLegend +=new Steema.TeeChart.Web.WebChart.ClickEventHandler(WebChart1_ClickLegend);
            flag = false;
        }
        else
        {
            ch1 = WebChart1.Chart;
            tmpChart.Position = 0;
            ch1.Import.Template.Load(tmpChart);
            WebChart1.ClickLegend += new Steema.TeeChart.Web.WebChart.ClickEventHandler(WebChart1_ClickLegend);
        }
    }
    protected void WebChart1_ClickLegend(object sender, ImageClickEventArgs e)
    {
        index = WebChart1.Chart.Legend.Clicked(e.X, e.Y);
        if (index != -1)
        {
            CheckedSeries chk = (CheckedSeries)checkedSeries[index];
            chk.IsActive = !chk.IsActive;
            checkedSeries.RemoveAt(chk.Index);
            checkedSeries.Insert(chk.Index, chk);
            System.Drawing.Bitmap bmp = WebChart1.Chart.Bitmap();
        }
    }
    protected void WebChart1_BeforeDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)
    {
        for (int i = 0; i < WebChart1.Chart.Series.Count; ++i)
        {
            CheckedSeries chk = (CheckedSeries)checkedSeries[i];
            WebChart1.Chart[i].Active = chk.IsActive;
        }
    }

    public struct CheckedSeries
    {
        public CheckedSeries(bool isActive, int index)
        {
            IsActive = isActive;
            Index = index;
        }
        public bool IsActive;
        public int Index;
Could you tell us, if previous code solves your problem?

I hope will helps.

Thanks,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

HitachiSteema
Newbie
Newbie
Posts: 13
Joined: Mon Aug 09, 2010 12:00 am
Contact:

Re: Saving the teechart with all the information that was set

Post by HitachiSteema » Wed Nov 17, 2010 6:49 pm

Hi Sandra,

Thanks for you quick response and your workaround code. I am sorry to say that the work around code does not even work.

I am unable to toggle the legend box.

Im also trying to do some modification of your small piece of code.

Thanks, Venu

HitachiSteema
Newbie
Newbie
Posts: 13
Joined: Mon Aug 09, 2010 12:00 am
Contact:

Re: Saving the teechart with all the information that was set

Post by HitachiSteema » Wed Nov 17, 2010 7:09 pm

Hi Sandra,

I don't want the tee chart to be saved & load as a image as it is not possible to check/uncheck the legend items.

Thanks,Venu

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Saving the teechart with all the information that was set

Post by Sandra » Thu Nov 18, 2010 9:45 am

Hello Venu,

Sorry I forgot a information. You need change AutoPostBack=false to AutoPostBack=true, because events work . Could you please, enable AutoPostBack and try again if workaround works as you want?

Thanks,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

HitachiSteema
Newbie
Newbie
Posts: 13
Joined: Mon Aug 09, 2010 12:00 am
Contact:

Re: Saving the teechart with all the information that was set

Post by HitachiSteema » Thu Nov 18, 2010 5:34 pm

Hi Sandra,

I am aware of AutoPostBack and its already enabled and I have been working on event like clicking on teechart will open another teechart information windows. My concern is that the teechart is saved as image and it is being loaded and that's why no able to perform any event on the tchart.

Thanks, Venu

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Saving the teechart with all the information that was set

Post by Sandra » Fri Nov 19, 2010 9:47 am

Hello Venu,

Please notice that WebChart is rendered as an image to the client and it can offer a limited level of interaction compared to WinForms version. So, If you want a dynamically Chart for web I recommend use TeeChartSilverlight, you can find it in the same installation of TeeChart.Net. Moreover Steema offers you other products that allow you work more dynamically with web Chart as: TeeChartActivex or TeeChartJava.

Thanks,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

HitachiSteema
Newbie
Newbie
Posts: 13
Joined: Mon Aug 09, 2010 12:00 am
Contact:

Re: Saving the teechart with all the information that was set

Post by HitachiSteema » Sat Nov 20, 2010 1:16 am

Hi Sandra,

I did not get a chance to see your mail very soon. I agree that teechart is rendered as image. But without your prototype code I was able to toggel the legend item checkbox.But with the workaround code its not possible to do a mouse event on the legend item.

When is next version of teechart will be available? Very soon I will be moving my project in the testing envirnoment and it will be good by that time if the legend item checkbox toggel works.

Thanks
Venu

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Saving the teechart with all the information that was set

Post by Sandra » Tue Nov 23, 2010 4:48 pm

Hello Venu,

Excuse us for the delay. We haven't forgotten you. We'll answer you asap.

Thanks,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

HitachiSteema
Newbie
Newbie
Posts: 13
Joined: Mon Aug 09, 2010 12:00 am
Contact:

Re: Saving the teechart with all the information that was set

Post by HitachiSteema » Tue Nov 30, 2010 11:12 pm

Hi Sandra,

Any Update?

Thanks

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Saving the teechart with all the information that was set

Post by Sandra » Tue Dec 07, 2010 4:01 pm

Hello HitachiSteema,

Sorry for delay. At the moment this is not implemented in WebChart and we are working to find a good solution for you. I inform you asap.

Thanks,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

HitachiSteema
Newbie
Newbie
Posts: 13
Joined: Mon Aug 09, 2010 12:00 am
Contact:

Re: Saving the teechart with all the information that was set

Post by HitachiSteema » Mon Dec 13, 2010 7:48 pm

Hello,

I have a another problem on how to display DateTime in the teechart horizontal or vertical axis?
I am able to see only the Date and no the time associated with the date.
I have set the DateTime property for the line chart series to true both in design & runtime but still only the date is displayed on the x axis.

my code snippet

ltTrend is the line series chart
ltd.DETMEDIANTREND.STORETS - datetime type
ltd.DETMEDIANTREND.MEDIALLT - double type

ltTrend.Series[0].Add(ltd.DETMEDIANTREND.STORETS, ltd.DETMEDIANTREND.MEDIALLT);
ltTrend.Series[0].XValues.DateTime = true;

the default datetime format for the teechart axis is either time or date depending upon the value passed in the "DateTimeDefaultFormat" is this causing problem, that the default is always set to Date?

Thanks,Venu

Post Reply