Profile Picture

Bar Chart with Axis Labels on right side

Posted By Sharath babu 11 Years Ago
Author
Message
Sharath babu
questionmark Posted 11 Years Ago
View Quick Profile
Junior Member

Junior Member (16 reputation)Junior Member (16 reputation)Junior Member (16 reputation)Junior Member (16 reputation)Junior Member (16 reputation)Junior Member (16 reputation)Junior Member (16 reputation)Junior Member (16 reputation)Junior Member (16 reputation)

Group: Forum Members
Last Active: 10 Years Ago
Posts: 16, Visits: 1
Hi Team,

Am generating bar chart with axis labels. i have to generate Axis labels on the right side of the bar charts as shown in the fig.

I have used

chart.SetPredefinedChartStyle(PredefinedChartStyle.HorizontalRight)

to set axis labels on right side. by using this am able to generate axis labels on the right side but data binding is happening from right side too.

but databinding should happens from left side
how do i achieve this..?


Thanks
Sharath RR

Attachments
nevron_20130520.bmp (134 views, 536.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: Last Week
Posts: 3,054, Visits: 4,009
Hi,

The following code demonstrates how to achieve this result:


   private void Form1_Load(object sender, EventArgs e)
   {
      nChartControl1.Legends.Clear();

      NChart chart = nChartControl1.Charts[0];

      NBarSeries bar1 = new NBarSeries();
      bar1.DataLabelStyle.Visible = false;
      bar1.FillStyle = new NColorFillStyle(Color.Crimson);
      bar1.Values.AddRange(new double[]{ 10, 20, 15 });
      chart.Series.Add(bar1);

      NBarSeries bar2 = new NBarSeries();
      bar2.DataLabelStyle.Visible = false;
      bar2.MultiBarMode = MultiBarMode.Stacked;
      bar2.FillStyle = new NColorFillStyle(Color.CornflowerBlue);
      bar2.Values.AddRange(new double[] { 12, 7, 6 });
      chart.Series.Add(bar2);

      NBarSeries bar3 = new NBarSeries();
      bar3.DataLabelStyle.Visible = false;
      bar3.MultiBarMode = MultiBarMode.Stacked;
      bar3.FillStyle = new NColorFillStyle(Color.LimeGreen);
      bar3.Values.AddRange(new double[] { 14, 21, 17 });
      chart.Series.Add(bar3);

      chart.SetPredefinedChartStyle(PredefinedChartStyle.HorizontalLeft);

      NAxis axisX = chart.Axis(StandardAxis.PrimaryX);
      NAxis axisY = chart.Axis(StandardAxis.PrimaryY);

      axisY.Visible = false;
      axisY.ScaleConfigurator.MajorGridStyle.ShowAtWalls = new ChartWallType[]{};

      ((NDockAxisAnchor)axisX.Anchor).AxisDockZone = AxisDockZone.FrontTop;
   }


Best Regards,
Nevron Support Team



Sharath babu
Posted 11 Years Ago
View Quick Profile
Junior Member

Junior Member (16 reputation)Junior Member (16 reputation)Junior Member (16 reputation)Junior Member (16 reputation)Junior Member (16 reputation)Junior Member (16 reputation)Junior Member (16 reputation)Junior Member (16 reputation)Junior Member (16 reputation)

Group: Forum Members
Last Active: 10 Years Ago
Posts: 16, Visits: 1
works fine..

Thanks
Sharath RR



Similar Topics


Reading This Topic