Gauges

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
acastro
Advanced
Posts: 204
Joined: Tue Oct 27, 2009 12:00 am

Gauges

Post by acastro » Wed Mar 05, 2014 10:26 am

When I add a gauge, it show the legend, but If i export it and load it again the legend isn't there.
Thanks

Code: Select all

 private void button1_Click(object sender, EventArgs e)
        {
            Steema.TeeChart.Styles.LinearGauge linearGauge = new Steema.TeeChart.Styles.LinearGauge(tChart1.Chart);
            linearGauge.Title = "titulo";
            linearGauge.Tag = "1\tx";
            linearGauge.ShowInLegend = true;
            linearGauge.RedLine.Visible = false;
            linearGauge.GreenLine.Visible = false;
            tChart1.Series.Add(linearGauge);

            tChart1.Series[0].FillSampleValues();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            string path = @"c:\gauges.ten";

            tChart1.Export.Template.IncludeData = false;
            tChart1.Export.Template.Save(path);
        }

        private void button3_Click(object sender, EventArgs e)
        {
            string path = @"c:\gauges.ten"; 
            tChart1.Import.Template.Load(path);
        }

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: Gauges

Post by Christopher » Thu Mar 06, 2014 9:24 am

wakeup wrote:When I add a gauge, it show the legend, but If i export it and load it again the legend isn't there.
It would be much appreciated if these reproducible defects could be added directly into Steema's bug database http://bugs.teechart.net. I've added this problem in as ID=619, and as you can see it has already been fixed.

The workaround is to set the ShowInLegend property back to true after importation, e.g.

Code: Select all

    System.IO.MemoryStream stream;

    private void button1_Click(object sender, EventArgs e)
    {
      tChart1.Clear();
      Steema.TeeChart.Styles.LinearGauge linearGauge = new Steema.TeeChart.Styles.LinearGauge(tChart1.Chart);
      linearGauge.Title = "titulo";
      linearGauge.Tag = "1\tx";
      linearGauge.ShowInLegend = true;
      linearGauge.RedLine.Visible = false;
      linearGauge.GreenLine.Visible = false;
      tChart1.Series.Add(linearGauge);

      tChart1.Series[0].FillSampleValues();
    }

    private void button2_Click(object sender, EventArgs e)
    {
      stream = new System.IO.MemoryStream();
      tChart1.Export.Template.Save(stream);
    }

    private void button3_Click(object sender, EventArgs e)
    {
      stream.Position = 0;
      tChart1.Import.Template.Load(stream);

      tChart1[0].ShowInLegend = true;
    }
Best Regards,
Christopher Ireland / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Instructions - How to post in this forum

Post Reply