Profile Picture

Bar alignement

Posted By K DR 14 Years Ago
Author
Message
K DR
Posted 14 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)

Group: Forum Members
Last Active: 14 Years Ago
Posts: 5, Visits: 1

Hi,

I would like to align a bar on its left side, to have the gap on the other side, instead of having a gap on each side. I couldn't find the property or method that could change the alignement of the bars. See the picture of what I'm looking for.



Attachments
probgap.png (43 views, 3.00 KB)
bob milanov
Posted 14 Years Ago
View Quick Profile
Supreme Being

Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)

Group: Forum Members
Last Active: 6 Months Ago
Posts: 153, Visits: 11

Hi,

You need to set the bar width to 100% and then enable view range inflate for the X axis - the code below introduces ten point inflate to the right:

NChart chart = nChartControl1.Charts[0];

NBarSeries bar = new NBarSeries();
bar.Values.Add(10);
bar.InflateMargins = false;
bar.WidthPercent = 100;
chart.Series.Add(bar);

NOrdinalScaleConfigurator scale = new NOrdinalScaleConfigurator();
scale.InflateViewRangeBegin = false;
scale.InflateViewRangeEnd = true;
scale.ViewRangeInflateMode = ScaleViewRangeInflateMode.Absolute;

scale.AbsoluteInflate = new NRange1DL(0, 15);
chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator = scale;

Hope this helps - let me know if you meet any problems.

Best regards,
Bob

 



Ed Espinoza
Posted 14 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)

Group: Forum Members
Last Active: 14 Years Ago
Posts: 2, Visits: 1

How do you do this with a Line or Area graph, or multi type graph?  I would like the x axis values to start right under the y axis.

Thanks



bob milanov
Posted 14 Years Ago
View Quick Profile
Supreme Being

Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)

Group: Forum Members
Last Active: 6 Months Ago
Posts: 153, Visits: 11

Hi Ed,

Generally you need to switch the X axis to linear scale and provide X values to the series in question. Almost all Cartesian series support XY Scatter mode (with the exception of few specific series such as Kagi/Renko). For example:

NChart chart = nChartControl1.Charts[0];
NLineSeries line = new NLineSeries();

line.DataLabelStyle.Visible = false;
line.UseXValues = true;

line.Values.Add(10);
line.XValues.Add(10);

line.Values.Add(23);
line.XValues.Add(20);

line.Values.Add(18);
line.XValues.Add(35);

chart.Series.Add(line);
chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator = new NLinearScaleConfigurator();

Produces a simple XY scatter line, with a linear X axis.

Hope this helps -let me know if you have any questions.

Best regards,
Bob



Ed Espinoza
Posted 14 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)

Group: Forum Members
Last Active: 14 Years Ago
Posts: 2, Visits: 1

Here is what I am trying to do...we have the old chart done in an earlier version of Nevron and I need to replicate it in the new chart.  As you can see the old chart goes from border to border with the xAxis values starting right up against the yAxis where as the new chart's tickmark starts to the right of the y Axis.

Thanks



Attachments
Old Chart.bmp (38 views, 795.00 KB)
New Chart.bmp (39 views, 539.00 KB)
bob milanov
Posted 14 Years Ago
View Quick Profile
Supreme Being

Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)

Group: Forum Members
Last Active: 6 Months Ago
Posts: 153, Visits: 11

Hi Ed,

You should clear the implicit content inflate added by the ordinal scale to the scale definition:

chart.Axis(StandardAxis.PrimaryX).UpdateScale();
chart.Axis(
StandardAxis.PrimaryX).Scale.ContentRangeInflators.Clear();

Let me know if you meet any problems...

Best reagrds,
Bob



K DR
Posted 14 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)

Group: Forum Members
Last Active: 14 Years Ago
Posts: 5, Visits: 1
Thanks for your answers



Similar Topics


Reading This Topic