We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Regarding Line Chart

Thread ID:

Created:

Updated:

Platform:

Replies:

74653 Jun 24,2008 07:30 AM UTC Jun 24,2008 09:47 AM UTC Windows Forms 1
loading
Tags: Chart
Administrator [Syncfusion]
Asked On June 24, 2008 07:30 AM UTC

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

Manohari [Syncfusion]
Replied On 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


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;