Group: Forum Members
Last Active: 8 Years Ago
Posts: 1,
Visits: 2
|
OLD Chart: This is a chart that works correctly in Nevron chart. 86% of original size (was 587x284) - Click to enlarge  NEW Charts Today we have a new requirement to update the chart with "Your Performance" - X axis to a number of bars with different colors as shown. 86% of original size (was 587x284) - Click to enlarge  Would you please confirm is this requirement doable? How would I solve/update the chart? Thank you in advance. Hong Tran
|
Group: Forum Members
Last Active: Last Month
Posts: 3,055,
Visits: 4,055
|
Hi Hong , Yes this requirement is doable - you need to do the following : 1 . Go to Chart \ Chart Areas \ Chart Area 0 \ Appearance . 2 . Select Color Mode = DataPoint . at this point the chart palette will be applied per data point ( not per series ) and the bar clusters will have different color . Then you need to modify the color of the second bar with custom code . To do this select the code tab and paste the following code : using System; using System.Drawing; using Nevron.GraphicsCore; using Nevron.Chart; using Nevron.ReportingServices; namespace MyNamespace { /// <summary> /// Sample class /// </summary> public class MyClass { /// <summary> /// Main entry point /// </summary> /// <param name="context"></param> public static void RSMain(NRSChartCodeContext context) { NChart chart = context.document.Charts[0]; NBarSeries bar = chart.Series[1] as NBarSeries; bar.FillStyles.Clear(); bar.BorderStyles.Clear(); bar.BorderStyle = new NStrokeStyle(0, Color.Gray); bar.FillStyle = new NColorFillStyle(Color.Gray); } } }
This code overrides the fill / border styles applied on data points from the designer and specifies another color for the bars ( in this case Color . Gray ). Hope this helps - let us know if you have any questions or meet any problems .
Best Regards, Nevron Support Team
|