Page 1 of 1

Chartbook and X-Axis granularity

Posted: Wed Oct 12, 2011 8:57 pm
by 15660151
Hello,

I plan on using a Chartbook to display data in various time granularity. One chart would display data in 15min steps, another would display it in hourly steps, another in daily, another in monthly.

I plan on saving this configuration using the Template.Save (Stream). I would save only the configuration and template information, not the actual series data. But I want to save the granularity of each graph (15min,hourly,daily, monthly) so that I can re-query the proper tables in my db when the user re-opens the graph at a later time.

My question: Is there a property in the TeeChart object where I could store this granularity information? Like a place to store "user data"? I don't want this information to change if the user "zooms in" or changes the graph in any way... this is kind of a "data query granularity".

Thanks for your time!
Marc.

Re: Chartbook and X-Axis granularity

Posted: Fri Oct 14, 2011 9:01 am
by narcis
Hi Marc,

Yes, you can use TChart's Tag property where you can store an object, for example:

Code: Select all

      tChart1.Tag = "15day";
      System.IO.MemoryStream stream = new System.IO.MemoryStream();

      tChart1.Export.Template.Save(stream);
      tChart1.Clear();

      stream.Position = 0;
      tChart1.Import.Template.Load(stream);
      tChart1.Header.Text = tChart1.Tag.ToString();

Re: Chartbook and X-Axis granularity

Posted: Thu Oct 20, 2011 3:07 pm
by 15660151
Thanks Narcis, I think that will do it.
Marc