Page 1 of 1
Multiple area chart with different colors for each area
Posted: Thu Sep 20, 2012 6:45 am
by 17262900
Hi
I am creating an area chart in an ios application with multiple area series.
I have set SeriesArea.Transparency = 40;
Due to this all area series appear in the same blue color:
- Screen shot 2012-09-20 at 12.03.21 PM.png (49.97 KiB) Viewed 8895 times
If i do not set the Transparency then it shows like :
- Screen shot 2012-09-20 at 12.06.26 PM.png (41.73 KiB) Viewed 8898 times
So in the screenshot above the two areas are overlapping each other.
Please let me know how to show both areas with some transparency and different colors.
Thanks
Re: Multiple area chart with different colors for each area
Posted: Fri Sep 21, 2012 2:09 pm
by Pep
Hello,
I cannot reproduce the problem here using the following code, could you please be so kind to check if it works for you?
Code: Select all
_controller.chart.Series.Add(new Steema.TeeChart.Styles.Area());
_controller.chart.Series.Add(new Steema.TeeChart.Styles.Area());
_controller.chart.Series.Add(new Steema.TeeChart.Styles.Area());
_controller.chart.Series[0].FillSampleValues(5);
_controller.chart.Series[1].FillSampleValues(5);
_controller.chart.Series[2].FillSampleValues(5);
Steema.TeeChart.Styles.Area area1 = _controller.chart.Series[0] as Steema.TeeChart.Styles.Area;
Steema.TeeChart.Styles.Area area2 = _controller.chart.Series[1] as Steema.TeeChart.Styles.Area;
Steema.TeeChart.Styles.Area area3 = _controller.chart.Series[2] as Steema.TeeChart.Styles.Area;
area1.Transparency = 40;
area2.Transparency = 40;
area3.Transparency = 40;
In the case the problem persist, please post the code you're using in order to test it here and fix if necessary.
Thanks1
Re: Multiple area chart with different colors for each area
Posted: Mon Sep 24, 2012 5:00 am
by 17262900
Hello Pep
Following is my source code:
Code: Select all
Steema.TeeChart.Drawing.ChartFont font = new Steema.TeeChart.Drawing.ChartFont();
font.Size = 5;
int SeriesCount = 2;
for (int i=1; i <= SeriesCount; i++)
{
Steema.TeeChart.Styles.Area SeriesArea = new Steema.TeeChart.Styles.Area(chart.Chart);
SeriesArea.Title = "Series" + i;
SeriesArea.Marks.Font = font;
SeriesArea.Transparency = 40;
SeriesArea.Marks.Visible = true;
SeriesArea.Marks.Style = Steema.TeeChart.Styles.MarksStyles.Value;
SeriesArea.Marks.Transparent = true;
}
for (int i=0; i < 10; i++)
{
for (int j=0; j < SeriesCount-1; j++)
{
chart.Chart.Series [j].Add(
Convert.ToDouble(i + j),
Convert.ToString(i + j) + "s"
);
}
}
Thanks
Re: Multiple area chart with different colors for each area
Posted: Mon Sep 24, 2012 1:59 pm
by 10050769
Hello incadea,
Your code helped us to detect your problem. Basically it is produced if you try to change values of transparency property before add points in series. I have added this issue in bug list report with number[TF02016355]. We will try to fix it to upcoming versions of TeeChartFor.Net. On the other hand, at the moment, to solve the problem you must change the values of transparency property after add points of series. You can do something as next code:
Code: Select all
Steema.TeeChart.Drawing.ChartFont font = new Steema.TeeChart.Drawing.ChartFont();
font.Size = 5;
int SeriesCount = 2;
for (int i=1; i <= SeriesCount; i )
{
Steema.TeeChart.Styles.Area SeriesArea = new Steema.TeeChart.Styles.Area(chart.Chart);
SeriesArea.Title = "Series" i;
SeriesArea.Marks.Font = font;
//SeriesArea.Transparency = 40;
SeriesArea.Marks.Visible = true;
SeriesArea.Marks.Style = Steema.TeeChart.Styles.MarksStyles.Value;
SeriesArea.Marks.Transparent = true;
}
for (int i=0; i < 10; i )
{
for (int j=0; j < SeriesCount-1; j )
{
chart.Chart.Series [j].Add(
Convert.ToDouble(i j),
Convert.ToString(i j) "s"
);
(chart.Chart.Series[j] as Steema.TeeChart.Styles.Area).Transparency = 40; //solve the problem.
}
}
I hope will helps.
Thanks,
Re: Multiple area chart with different colors for each area
Posted: Tue Sep 25, 2012 4:39 am
by 17262900
Thanks Sandra. My problem is solved.