Profile Picture

Custom axes in 3D chart

Posted By Manal Goyal 6 Years Ago
Author
Message
Manal Goyal
Question Posted 6 Years Ago
View Quick Profile
Forum Member

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
Last Active: 5 Years Ago
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
This post has been flagged as an answer
Posted 6 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)

Group: Forum Members
Last Active: Last Year
Posts: 3,039, Visits: 3,746
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
This post has been flagged as an answer
Posted 6 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)

Group: Forum Members
Last Active: Last Year
Posts: 3,039, Visits: 3,746
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





Similar Topics


Reading This Topic