DataLabelStyle.TextStyle.Offset


Author
Message
frederik borg
frederik borg
Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)
Group: Forum Members
Posts: 4, Visits: 1
Works perfect thanks!

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,

Please try the following code:

private void Form1_Load(object sender, EventArgs e)
{
    NChartControl cc1 = GetChartControl();

    // remove default panels
   
cc1.Panels.Clear();

    NCartesianChart chart = new NCartesianChart();
    cc1.Charts.Add(chart);
    chart.Enable3D =
false;
    chart.Projection.SetPredefinedProjection(
PredefinedProjection.OrthogonalHorizontalLeft);

    NBarSeries bar = (NBarSeries)chart.Series.Add(SeriesType.Bar);
    bar.Values.Add(7.094);
    bar.Values.Add(3);
    bar.Values.Add(4.55);
    bar.Values.Add(1.453);

    // no need to add labels if you just want to show the bar values
    // bar.Labels.Add("7");
    // bar.Labels.Add("3");
    // bar.Labels.Add("4");
    // bar.Labels.Add("1");

    // tell the chart to show the bar values in the data labels
    bar.DataLabelStyle.Format = "<value>";

    // show the labels inside the bars
    bar.DataLabelStyle.ArrowLength = new NLength(-2);
    bar.DataLabelStyle.TextStyle.StringFormatStyle.HorzAlign = Nevron.
HorzAlign.Right;

    // hide the label arrow
    bar.DataLabelStyle.ArrowStrokeStyle.Width = new NLength(0);

    // hide the label backplane
   
bar.DataLabelStyle.TextStyle.BackplaneStyle.Visible =
false;
}



Best Regards,
Nevron Support Team


frederik borg
frederik borg
Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)
Group: Forum Members
Posts: 4, Visits: 1
Hi, I'm currently evaluating the nevron charts, using asp.net.

I'm trying to create a horisontal bar chart but would like the data labels to be displayed inside the bars, aligned near the end of the bar.
I am trying to use DataLabelStyle.TextStyle.Offset on my NBarSeries but this seems to have no effect regardless of values used.

Here's my example code:

NChartControl cc1 = GetChartControl();
NCartesianChart chart = new NCartesianChart();

cc1.Charts.Add(chart);

chart.Enable3D = false;
chart.Projection.SetPredefinedProjection(PredefinedProjection.OrthogonalHorizontalLeft);

NBarSeries bar = (NBarSeries)chart.Series.Add(SeriesType.Bar);
bar.Values.Add(7);
bar.Values.Add(3);
bar.Values.Add(4);
bar.Values.Add(1);

bar.Labels.Add("7");
bar.Labels.Add("3");
bar.Labels.Add("4");
bar.Labels.Add("1");

bar.DataLabelStyle.TextStyle.BackplaneStyle.Visible = false;
bar.DataLabelStyle.TextStyle.Offset = new NPointL(-30, 30); //How to move label?


Thanks,
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