Profile Picture

Two types of multiple clustered series overlaid

Posted By Rick Shaban 11 Years Ago
Author
Message
Rick Shaban
Posted 11 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)

Group: Forum Members
Last Active: 11 Years Ago
Posts: 6, Visits: 1
Hi,

I'm trying to overlay two types of multiple clustered series. One is a cluster of multiple bar series and the other is a cluster of multiple float bar series. The attached chart example shows that I have managed to get them to display next to each other but I would like the float bar to display over the standard bar.

I have though of separating both elements out into two overlaid charts but worry about aligning both charts and was wondering if there was an easier way of doing this? such as a command for offsetting the the float bar to the left.

Best regards,

Rick

Nevron Support
Posted 11 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Yesterday @ 1:54 AM
Posts: 3,054, Visits: 4,009
The attachment is missing, can you try adding the attachment once again.

Best Regards,
Nevron Support Team



Rick Shaban
Posted 11 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)

Group: Forum Members
Last Active: 11 Years Ago
Posts: 6, Visits: 1
That's strange I ticked the box and selected the file.

Attachments
Chart example.png (137 views, 41.00 KB)
Rick Shaban
Posted 11 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)

Group: Forum Members
Last Active: 11 Years Ago
Posts: 6, Visits: 1
Hi,

I've not heard back but have been testing with settings. I get both cluster types to overlap by editing the width percent and gap percent on each of the chart series.

self.WidthPercent = 50
self.GapPercent = -100

The attached image shows the result, which is close but still needs to be shifted a bit so that both types are aligned.

Any help would be appreciated.

Best regards,

Rick

Attachments
Multi-Cluster Attempt 2.png (141 views, 42.00 KB)
Nevron Support
Posted 11 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Yesterday @ 1:54 AM
Posts: 3,054, Visits: 4,009
Hi Rick,

To get the floatbars aligned with the bars, you simply have to place them in two different "series" of clusters:
The first Floatbar series must be in mode "Series" and the following Floatbar series must be in mode "Clustered". Then the first Bar series must be again in mode "Series" and the following Bar series again must be in mode "Clustered". Setting the first Bar series to "Series" mode will make all bars to be placed in a different depth "layer" from the floating bars.


   NCartesianChart chart = (NCartesianChart)nChartControl1.Charts[0];

   for (int i = 0; i < 4; i++)
   {
      NFloatBarSeries fb = new NFloatBarSeries();
      fb.BeginValues.AddRange(new double[] { 11, 7, 12, 8 });
      fb.EndValues.AddRange(new double[] { 12, 8, 13, 9 });
      fb.DataLabelStyle.Visible = false;
      chart.Series.Add(fb);

      if (i == 0)
         fb.MultiFloatBarMode = MultiFloatBarMode.Series;
      else
         fb.MultiFloatBarMode = MultiFloatBarMode.Clustered;
   }

   for (int i = 0; i < 4; i++)
   {
      NBarSeries bar = new NBarSeries();
      bar.Values.AddRange(new double[]{ 10, 5, 10, 5 });
      bar.DataLabelStyle.Visible = false;
      chart.Series.Add(bar);

      if (i == 0)
         bar.MultiBarMode = MultiBarMode.Series;
      else
         bar.MultiBarMode = MultiBarMode.Clustered;
   }



Best Regards,
Nevron Support Team



Rick Shaban
Posted 11 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)

Group: Forum Members
Last Active: 11 Years Ago
Posts: 6, Visits: 1
Thanks. It works now. I have attached a sample image. I only have one question left.

As I have multiple series for the float bars I'd like to hide all instances in the legend except for the first one.

I tried:

RangeM.Legend.DisplayOnLegend.VisibilityMode = VisibilityMode.Hidden

but then get the error "NullReferenceException was unhandled by user code" on this line. "Object reference not set to an instance of an object."

How can this be corrected?

Attachments
Working.png (129 views, 36.00 KB)
Nevron Support
Posted 11 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Yesterday @ 1:54 AM
Posts: 3,054, Visits: 4,009

Hi Rick,

In order to specify that a particular series must not be visible in the legend you must use:

someSeries.Legend.Mode = SeriesLegendMode.None;

Let us know if you meet any problems...



Best Regards,
Nevron Support Team



Rick Shaban
Posted 11 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)

Group: Forum Members
Last Active: 11 Years Ago
Posts: 6, Visits: 1
It worked perfectly. Thanks very much.



Similar Topics


Reading This Topic