I m working on data visualization Chart Control i m new in this . i have create one Chart Which Consist three chart area Chart Area1 ,SublineChart and IntersectlineChart Area
subLineChartArea = new ChartArea("subLineChartArea");
subLineChartArea.Position = elementPosition;
subLineChartArea.InnerPlotPosition = elementPosition;
subLineChartArea.BackColor = Color.Transparent;
subLineChartArea.AxisX.Minimum = (double)Math.Round(minXValue, 2);
if (Math.Round(maxXValue, 2) > 0)
subLineChartArea.AxisX.Maximum = (double)Math.Round(maxXValue, 2);
else
subLineChartArea.AxisX.Maximum = maxXValue;
subLineChartArea.AxisY.Interval = (double)Math.Round(intensityGraphSettings.MajorTickMarksYValue, 2);
subLineChartArea.AxisY.Maximum = (double)Math.Round(maxYValue, 2);
subLineChartArea.AxisY.Minimum = (double)Math.Round(minYValue, 2);
subLineChartArea.AxisY.TitleAlignment = StringAlignment.Center;
subLineChartArea.AxisY.TextOrientation = TextOrientation.Auto;
subLineChartArea.AxisX.Interval = (double)Math.Round(intensityGraphSettings.MajorTickMarksXValue, 2);
subLineChartArea.AxisX.Maximum = (double)Math.Round(maxXValue, 2);
subLineChartArea.AxisX.Minimum = (double)Math.Round(minXValue, 2);
subLineChartArea.AxisX.IntervalAutoMode = IntervalAutoMode.FixedCount;
subLineChartArea.AxisX.IntervalType = DateTimeIntervalType.Number;
subLineChartArea.AxisX.Interval = (double)Math.Round(intensityGraphSettings.MajorTickMarksXValue, 2);
subLineChartArea.AxisX.MinorTickMark.Enabled = true;
subLineChartArea.AxisX.MinorTickMark.Interval = (double)Math.Round(intensityGraphSettings.MinorTickMarksXValue, 2);
foreach (Axis axis in subLineChartArea.Axes)
{
axis.Enabled = AxisEnabled.False;
}
intensityGraph.ChartAreas.Add(subLineChartArea);
Above Code Represent how to make intersect lines , While i Zoom this chart it working Fine but my problem is that whenever I scroll The the Chart All lines are moving accept intersect lines. i checked the points of Subline Series and Scale view Size and postion of all the chart Area is same.
Below are the Zoom Code
try
{
intensityGraph.ChartAreas[0].AxisX.LabelStyle.Format = "N0";
intensityGraph.ChartAreas[0].AxisY.LabelStyle.Format = "N0";
intensityGraph.ChartAreas[0].AxisX.ScrollBar.BackColor = Color.LightGray;
intensityGraph.ChartAreas[0].AxisX.ScrollBar.ButtonColor = Color.LightSteelBlue;
intensityGraph.ChartAreas[0].AxisX.ScrollBar.LineColor = Color.DarkBlue;
intensityGraph.ChartAreas[0].AxisX.ScrollBar.ButtonStyle = ScrollBarButtonStyles.All;
intensityGraph.ChartAreas[0].AxisY.ScrollBar.BackColor = Color.LightGray;
intensityGraph.ChartAreas[0].AxisY.ScrollBar.ButtonColor = Color.LightSteelBlue;
intensityGraph.ChartAreas[0].AxisY.ScrollBar.LineColor = Color.DarkBlue;
intensityGraph.ChartAreas[0].AxisY.ScrollBar.ButtonStyle = ScrollBarButtonStyles.All;
if (XScaleSize == 0)
{
intensityGraph.ChartAreas[0].AxisX.ScaleView.Size = intensityGraph.ChartAreas[0].AxisX.ScaleView.ViewMaximum - intensityGraph.ChartAreas[0].AxisX.ScaleView.ViewMinimum;
XScaleSize = intensityGraph.ChartAreas[0].AxisX.ScaleView.ViewMaximum - intensityGraph.ChartAreas[0].AxisX.ScaleView.ViewMinimum;
XScaleMinSize = XScaleSize;
XScaleMaxSize = XScaleSize / 10;
XScaleSizeFirstvalue = XScaleSize / 1.25;
}
if (XScaleSize > XScaleMaxSize)
{
intensityGraph.ChartAreas[0].AxisX.ScaleView.Size = XScaleSize / 1.25;
intensityGraph.ChartAreas[1].AxisX.ScaleView.Size = XScaleSize / 1.25;
intensityGraph.ChartAreas[2].AxisX.ScaleView.Size = XScaleSize / 1.25;
XScaleSize = XScaleSize / 1.25;
}
if (YScaleSize == 0)
{
intensityGraph.ChartAreas[0].AxisY.ScaleView.Size = intensityGraph.ChartAreas[0].AxisY.ScaleView.ViewMaximum - intensityGraph.ChartAreas[0].AxisY.ScaleView.ViewMinimum;
YScaleSize = intensityGraph.ChartAreas[0].AxisY.ScaleView.ViewMaximum - intensityGraph.ChartAreas[0].AxisY.ScaleView.ViewMinimum;
YScaleMinSize = YScaleSize;
YScaleMaxSize = YScaleSize / 10;
YScaleSizeFirstvalue = YScaleSize / 1.25;
}
if (YScaleSize > YScaleMaxSize)
{
intensityGraph.ChartAreas[0].AxisY.ScaleView.Size = YScaleSize / 1.25;
intensityGraph.ChartAreas[1].AxisY.ScaleView.Size = YScaleSize / 1.25;
intensityGraph.ChartAreas[2].AxisY.ScaleView.Size = YScaleSize / 1.25;
YScaleSize = YScaleSize / 1.25;
}
intensityGraph.ChartAreas[1].AxisX.ScaleView.Position = intensityGraph.ChartAreas[0].AxisX.ScaleView.Position;
intensityGraph.ChartAreas[2].AxisX.ScaleView.Position = intensityGraph.ChartAreas[0].AxisX.ScaleView.Position;
DrawSubLinesOnGraph(SubLineDrawType.All);
DrawIntersectLineOnGraph();
}
catch (Exception ex)
{
MessageBox.Show(Properties.Resources.IG_Error_While_ZoomIn_Chart, Properties.Resources.Application_Title, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
Please suggest Me why Only Sublines series not moving correctly while the datapoints
are same .i m unable to Add Picutre of graph here u can see it
http://social.msdn.microsoft.com/Forums/en-US/MSWinWebChart/thread/a888f1ed-4254-47ce-a26e-cb6a86815324[
^][
]
Thanks
Shashank Tyagi