Custom axes in 3D chart


Author
Message
Manal Goyal
Manal Goyal
Forum Member (44 reputation)Forum Member (44 reputation)Forum Member (44 reputation)Forum Member (44 reputation)Forum Member (44 reputation)Forum Member (44 reputation)Forum Member (44 reputation)Forum Member (44 reputation)Forum Member (44 reputation)
Group: Forum Members
Posts: 29, Visits: 405
Hi Team,

I have a 3D chart where on the x axis I have the range from -15 to 15. Now what I want is to have  different ranges on the axis, the half of my axis is to have a range from 15 to 10(left to right) and then again the later half of my axis should have a range of 10 to 15(from left to right).

How can I achieve this using nevron. Hope its not confusing. Please let me know if more clarification is needed on this.

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 Manal,
In short you need to have the two axes share the same axis zone level which is achieved by setting the CreateNewZoneLevel property of the Anchor to false, then you need to have another axis that shows the title at the center - for example:
   NCartesianChart chart = (NCartesianChart)nChartControl1.Charts[0];

    NBarSeries bar1 = new NBarSeries();
    bar1.Values.Add(10);
    bar1.Values.Add(20);
    bar1.Values.Add(30);
    bar1.Values.Add(40);
    chart.Series.Add(bar1);

    NBarSeries bar2 = new NBarSeries();
    bar2.Values.Add(10);
    bar2.Values.Add(20);
    bar2.Values.Add(30);
    bar2.Values.Add(40);
    chart.Series.Add(bar2);

    NBarSeries invisibleBars = new NBarSeries();
    invisibleBars.Values.Add(0);
    invisibleBars.FillStyle = new NColorFillStyle(Color.Transparent);
    invisibleBars.BorderStyle.Width = new NLength(0);
    chart.Series.Add(invisibleBars);

    chart.Axis(StandardAxis.PrimaryX).Visible = false;

    NAxis xAxis1 = ((NCartesianAxisCollection)chart.Axes).AddCustomAxis(AxisOrientation.Horizontal, AxisDockZone.FrontBottom);
    NDockAxisAnchor dockAnchor1 = new NDockAxisAnchor(AxisDockZone.FrontBottom, false);
    dockAnchor1.BeginPercent = 0;
    dockAnchor1.EndPercent = 50;
    dockAnchor1.CreateNewZoneLevel = false;
    xAxis1.Anchor = dockAnchor1;

    bar1.DisplayOnAxis(StandardAxis.PrimaryX, false);
    bar1.DisplayOnAxis(xAxis1.AxisId, true);

    NAxis xAxis2 = ((NCartesianAxisCollection)chart.Axes).AddCustomAxis(AxisOrientation.Horizontal, AxisDockZone.FrontBottom);
    NDockAxisAnchor dockAnchor2 = new NDockAxisAnchor(AxisDockZone.FrontBottom, false);
    dockAnchor2.BeginPercent = 50;
    dockAnchor2.EndPercent = 100;
    dockAnchor2.CreateNewZoneLevel = false;
    xAxis2.Anchor = dockAnchor2;

    bar2.DisplayOnAxis(StandardAxis.PrimaryX, false);
    bar2.DisplayOnAxis(xAxis2.AxisId, true);

    NAxis xAxis3 = ((NCartesianAxisCollection)chart.Axes).AddCustomAxis(AxisOrientation.Horizontal, AxisDockZone.FrontBottom);
    xAxis3.Visible = true;
    xAxis3.ScaleConfigurator.Title.Text = "Some Text";
    invisibleBars.DisplayOnAxis(StandardAxis.PrimaryX, false);
    invisibleBars.DisplayOnAxis(xAxis3.AxisId, true);


Best Regards,
Nevron Support Team


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 Manal,
You need to specify that the axis scale is inverted - this is a property of the scale configurator:
chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator.Invert = true;
Hope this helps - let us know if you meet any problems.

Best Regards,
Nevron Support Team


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