Hi,
I would like to know how to change the color of the line of a certain serie.
Hello Ignacio,
Thank you for posting in the community !
In order to change the color of a particular series in an Ignite UI line chart, a SolidColorBrush may be created and set as the Brush to use for the given series, for instance:
ValueCategorySeries series=new LineSeries(); series.setCategoryAxis(categoryAxis); // tell the series its x axis series.setValueAxis(valueAxis); // tell the series its y axis series.setValueMember(""); // tell the series the data rows are the values series.setDataSource(column2); // tell the series the data table Brush serieColorBrush = new SolidColorBrush(Color.RED); series.setBrush(serieColorBrush);
Please note that this approach may also be used for other types of series.
Hope this helps.
Is there a way to set a Brush that isn't solid? Because with this kind of brush I lose all the transaprency that we have with the default colors.
Thank you for your reply and apologies for the late response.
The Iguana UI chart offers a number of different gradient brushes which would also allow keeping the series' transparency if needed. For instance, in order to create a LinearGradient Brush:
//Create a Green-transparent linear gradient brush Brush gradientBrush = new LinearGradientBrush(); ((LinearGradientBrush) gradientBrush).setColors(new int[]{ Color.TRANSPARENT, Color.GREEN}); series.setBrush(gradientBrush); dataChart.series().add(series);
Hi Petar,
Could you please provide me the complete example for the above..
Thanks,
Naresh