multiple bar colors


Author
Message
Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K
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


Hong Tran
Hong Tran
Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)
Group: Forum Members
Posts: 1, Visits: 2
OLD Chart:
This is a chart that works correctly in Nevron chart.

 
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. 

  
Would you please confirm is this requirement doable?  How would I solve/update the chart?  Thank you in advance.
Hong Tran
  

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search