Regarding Line Chart

Hi

Is it possible to line chart with Color?I have attached image with it.Please reply me it is urgernt.

Regards
Pankaj Sardana



Linechart_6dc01ceb.zip

1 Reply

MA Manohari Syncfusion Team June 24, 2008 09:47 AM UTC

Hi Pankaj,

It is possible to display LineChart with different colors using the ChartSeries.Style.Interior property. This property can be set directly using the this.ChartControl1.Series[0].Styles[0].Interior property. And Colors to the Points can also be set using the PrepareStyle event args as shown below.

Sample code:

this.chartControl1.Series[0].PrepareStyle += new ChartPrepareStyleInfoHandler(series_PrepareStyle);
...
...
void series_PrepareStyle(object sender, ChartPrepareStyleInfoEventArgs args)
{
//Specifying different Colors for data points using Prepare style event
ChartSeries series = sender as ChartSeries;
if (series != null)
{
if (args.Index == 0)
args.Style.Interior = new Syncfusion.Drawing.BrushInfo(Color.Red);
else if (args.Index == 1)
args.Style.Interior = new Syncfusion.Drawing.BrushInfo(Color.Green);
else if (args.Index == 2)
...
...
}

Please refer to the sample attached in the below link which illustrates the same.

http://websamples.syncfusion.com/samples/Chart.Windows/F74653/Main.htm

Kindly let us know if you have any other queries. Thanks for your patience.

Regards,
Manohari.R


Loader.
Up arrow icon