Profile Picture

Chart Control Border Color

Posted By inhyuk son 13 Years Ago
Author
Message
inhyuk son
Posted 13 Years Ago
View Quick Profile
Junior Member

Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)

Group: Forum Members
Last Active: 12 Years Ago
Posts: 21, Visits: 1
Hi~

Is there a way to set the chart border color?

thank you.

Nevron Support
Posted 13 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
You can set the border color for both the chart control and the chart itself.
Please let us know which border do you need to change.

Best Regards,
Nevron Support Team



inhyuk son
Posted 13 Years Ago
View Quick Profile
Junior Member

Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)

Group: Forum Members
Last Active: 12 Years Ago
Posts: 21, Visits: 1
Hi~
I want to change the border color of chart control.
Thanks a lot.

Attachments
border.GIF (737 views, 4.00 KB)
Nevron Support
Posted 13 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 Inhyuk,

You have to touch the inner border color of the control frame:

NStandardFrameStyle frame = nChartControl1.BackgroundStyle.FrameStyle as NStandardFrameStyle;
frame.InnerBorderColor =
Color.Cyan;



Best Regards,
Nevron Support Team



Syrhey Karol'
Posted 12 Years Ago
View Quick Profile
Forum Member

Forum Member (27 reputation)Forum Member (27 reputation)Forum Member (27 reputation)Forum Member (27 reputation)Forum Member (27 reputation)Forum Member (27 reputation)Forum Member (27 reputation)Forum Member (27 reputation)Forum Member (27 reputation)

Group: Forum Members
Last Active: Last Year
Posts: 21, Visits: 74
Hi!

I know how to draw a frame around a chart control and around a chart.
Is it possible to draw a frame around a chart greed? Like the red square in the attach.

Best Regards,
Zonder.


Attachments
grid_frame.png (371 views, 2.00 KB)
Nevron Support
Posted 12 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 Zonder,

Try using the border style of the back wall:

chart.Wall(ChartWallType.Back).BorderStyle.Color = Color.Black;

 



Best Regards,
Nevron Support Team



Syrhey Karol'
Posted 12 Years Ago
View Quick Profile
Forum Member

Forum Member (27 reputation)Forum Member (27 reputation)Forum Member (27 reputation)Forum Member (27 reputation)Forum Member (27 reputation)Forum Member (27 reputation)Forum Member (27 reputation)Forum Member (27 reputation)Forum Member (27 reputation)

Group: Forum Members
Last Active: Last Year
Posts: 21, Visits: 74
Hi Guys!

Thank you very much!
It works perfect

Best Regards,
Zonder


Syrhey Karol'
Posted 12 Years Ago
View Quick Profile
Forum Member

Forum Member (27 reputation)Forum Member (27 reputation)Forum Member (27 reputation)Forum Member (27 reputation)Forum Member (27 reputation)Forum Member (27 reputation)Forum Member (27 reputation)Forum Member (27 reputation)Forum Member (27 reputation)

Group: Forum Members
Last Active: Last Year
Posts: 21, Visits: 74
Hi, Guys!

I am sorry. But there is a problem with drawing ‘Grid Border’ using ‘Back Wall Border’
1) If I hide grid lines all works fine.
Here is the code:
NCartesianChart chart = (NCartesianChart)nChartControl1.Charts[0];

NBarSeries bar = new NBarSeries();
bar.Values.Add(10);
bar.Values.Add(21);
chart.Series.Add(bar);

// Grid Border
NChartWall backWall = chart.Wall(ChartWallType.Back);
backWall.BorderStyle.Color = Color.Black;

// Hide grid lines
chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator.MajorGridStyle.SetShowAtWall(ChartWallType.Back, false);
chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator.MajorGridStyle.SetShowAtWall(ChartWallType.Back, false);

And you can see the result at picture gridBorder1.

2) But I need to have greed line enabled.
Here is the code:
NCartesianChart chart = (NCartesianChart)nChartControl1.Charts[0];

NBarSeries bar = new NBarSeries();
bar.Values.Add(10);
bar.Values.Add(21);
chart.Series.Add(bar);

// Grid Border
NChartWall backWall = chart.Wall(ChartWallType.Back);
backWall.BorderStyle.Color = Color.Black;

// Show grid lines
chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator.MajorGridStyle.SetShowAtWall(ChartWallType.Back, true);
chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator.MajorGridStyle.SetShowAtWall(ChartWallType.Back, true);


And as a result the latest grid line overlaps grid border line.
You can see the result at picture gridBorder2.
Do you know another way how to draw grid border?

Best Regards,
Zonder.


Attachments
gridBorder1.png (252 views, 6.00 KB)
gridBorder2.png (392 views, 13.00 KB)
Nevron Support
Posted 12 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 Zonder,

One way to workaround this is to use the custom painting feature (All Examples\Custom Painting). That way you'll be able to write on top of every chart element... 



Best Regards,
Nevron Support Team



Syrhey Karol'
Posted 12 Years Ago
View Quick Profile
Forum Member

Forum Member (27 reputation)Forum Member (27 reputation)Forum Member (27 reputation)Forum Member (27 reputation)Forum Member (27 reputation)Forum Member (27 reputation)Forum Member (27 reputation)Forum Member (27 reputation)Forum Member (27 reputation)

Group: Forum Members
Last Active: Last Year
Posts: 21, Visits: 74
Hi Guys.

Custom painting approach doesn’t help here. Custom painted border doesn’t coincide with real grid border because of coordinate transformation from scale to view.

I’ve managed to draw a grid frame but with a trick method:
I’ve added secondary axes and hide ticks and labels on them.

private void Form1_Load(object sender, EventArgs e)
{
_chart = (NCartesianChart)nChartControl1.Charts[0];

NBarSeries bar = new NBarSeries();
bar.Values.Add(10);
bar.Values.Add(21);
_chart.Series.Add(bar);


//add secondary axes
NAxis secondaryXAxis = _chart.Axis(StandardAxis.SecondaryX);
InitSecondaryAxis(ref secondaryXAxis);

NAxis secondaryYAxis = _chart.Axis(StandardAxis.SecondaryY);
InitSecondaryAxis(ref secondaryYAxis);
}

private void InitSecondaryAxis(ref NAxis axis)
{
//make axis visible in general
axis.Visible = true;
//make axis visible to provade it a fake interval
axis.View = new NRangeAxisView(new NRange1DD(1, 2), true, true);

NLinearScaleConfigurator scale = new NLinearScaleConfigurator();
//switch off ticks and labels
scale.InnerMajorTickStyle.Length = new NLength(0);
scale.OuterMajorTickStyle.Length = new NLength(0);
scale.AutoLabels = false;

//set axis color
scale.RulerStyle.BorderStyle.Color = Color.Black;

axis.ScaleConfigurator = scale;
}


Best Regards,
Zonder.




Similar Topics


Reading This Topic