I have some charts and want if user zoom into a chart, other charts show the same range on X-axis and left lines of charts fit in a common vertical line(as shown in the picture)
how to that in Nevron charts?
The following code shows how to synchronize the ranges of the x axes as well as how to align the charts left panels:
Synchronize the axis range:
// make axes master slave
chart1.Axis(StandardAxis.PrimaryX).Slaves.Add(chart2.Axis(StandardAxis.PrimaryX));
chart2.Axis(StandardAxis.PrimaryX).Slaves.Add(chart1.Axis(StandardAxis.PrimaryX));
Align the charts:
// align the charts
NSideGuideline guideline = new NSideGuideline(PanelSide.Left);
guideline.Targets.Add(chart1);
guideline.Targets.Add(chart2);
nChartControl1.Document.RootPanel.Guidelines.Add(guideline);
Related
Is there any way to get the coordinates of the X axis of the vertical Maijor Grid shown in the chart below?
For example, 11, 20, 32......... in order from left to right.
Dividing the length of the X axis of the chart plot area by the number of Maijor Grids did not give the exact coordinates (because the undivided portion was truncated?).
I'm using a System.Windows.Forms.DataVisualization.Charting.Chart
Chart Axis X Min and Max are set prior to adding data (Min=0 Max=13500).
After adding two or more points in a Series (inside X limits), X axis labels changes. How can I prevent that?
Chart axis before adding data:
Chart axis after adding two or more points:
Actually my chart is looking like that:
As you can see the labels are overlapped with the other series. How can I set the label for series2 (=columns) to the bottom above the x-axis? It seems there is no property for that?
Thanks
You can show the y-values of one series at one axis. This can be the primary axis (at the bottom), but then the x-values won't show. Or it can be the secondary axis; for this here is what you can do:
First enable the second x-axis :
chart.ChartAreas[0].AxisX2.Enabled = AxisEnabled.True;
Then associate the series you want to this secondary axis:
yourSeries.XAxisType = AxisType.Secondary;
Finally tell the series to display its y-values on its axis labels:
yourSeries.AxisLabel = "#VAL";
If your other series shows its values close to the points:
yourOtherSeries.IsValueShownAsLabel = true;
..this could be the result :
Here I have colored the axis labels to go with their series:
chart.ChartAreas[0].AxisX2.LabelStyle.ForeColor = yourSeries.Color;
I am programming in C# on VB2010 and I am wanting to shade under the line that is made on my chart. I have a chart with 7 separate values on the X-axis and adjust them with a trackbar for the height on the Y-axis. First I would like to know how to have my line (I'm currently using the Spline type Series chart) display shading under where the line is to the bottom of my chart; and to also have my chart display the new value on the chart immediately after moving the trackbar so that I don't have to click on the chart to update the display.
I am able to create bar chart and displaying strip line through MS Chart below snap:
Same chart I am trying to create in C# at run time feel like to export the chart in excel. Can anyone guide me how can draw the Strip line on bar chart OR can combine bar chart line chart so line chart seems displaying the strip line.
one possible approach is to add a new series like this:
add a new series to the bar chart, using 2 cells equal to the value where you want to have vertical line (x column in illustration)
select the new series bars and change chart type to X Y (Scatter) - the one with both markers and lines so you can then select it again
edit data range for the new series, so x-values point to your value and y-values to 0 and 1
change the right axis to Minimum: Fixed 0,0, Maximum: Fixed 1,0 and change major tick lines and axis labels to None
remove markers and change line style