Hi Mike,
a) showing tooltips - the chart overlap them....
This is caused because you use annotations instead of data point labels (where the chart has an option to resolve overlapping data labels and to push them inside the plot bounds). The following code snippet shows how to enable data labels:
NChart chart = nChartControl1.Charts[0];
chart.LabelLayout.EnableInitialPositioning = true;
chart.LabelLayout.EnableLabelAdjustment = true;
NLineSeries line = new NLineSeries();
chart.Series.Add(line);
line.DataLabelStyle.Visible = true;
line.DataLabelStyle.Format = "<value> <label>";
line.Values.Add(10);
line.Labels.Add("Some Label 1");
line.Values.Add(20);
line.Labels.Add("Some Label 2");
b) disapearing labels on Y-axe - the upper label only partly is drawn
You need to provide some margin to the chart:
chart.Margins = new Nevron.GraphicsCore.NMarginsL(10);
It is probably docked to fill the whole area so that's why the upper part of the last y label get cut off.
c) the custom legend isn't shown... only in Automatic mode but thus it covered by itself the X-Axe...
The legend is not populated with data - we could not see where you add the custom legend item to the legend. If you want to use an automatic legend then you need to connect it to the chart - after both the chart and the legend panels are added to the document you need to write:
chart.DisplayOnLegend = legend;
where legend is a reference to the legend panel you created.
d) how to make multichart with one chartcontrol where all charts are vertical aligned and synchronized on datetime X-Axe during Zoom operation.
The following code snippet shows how to create two charts that have a synchronized x axis. The user can zoom and scroll the second chart and the first chart will be updated automatically:
protected void Page_Load(object sender, EventArgs e)
{
if (!NThinChartControl1.Initialized)
{
NThinChartControl1.BackgroundStyle.FrameStyle.Visible = false;
NThinChartControl1.Panels.Clear();
// create the top chart
NCartesianChart chart1 = new NCartesianChart();
NThinChartControl1.Panels.Add(chart1);
chart1.Location = new NPointL(0, 0);
chart1.Margins = new NMarginsL(10);
chart1.BoundsMode = BoundsMode.Stretch;
chart1.Size = new NSizeL(new NLength(100, NRelativeUnit.ParentPercentage), new NLength(50, NRelativeUnit.ParentPercentage));
NPointSeries point1 = new NPointSeries();
point1.DataLabelStyle.Visible = false;
GenerateXYData(point1);
chart1.Series.Add(point1);
// create the bottom chart
NCartesianChart chart2 = new NCartesianChart();
chart2.Margins = new NMarginsL(10);
NThinChartControl1.Panels.Add(chart2);
chart2.Location = new NPointL(new NLength(0), new NLength(50, NRelativeUnit.ParentPercentage));
chart2.BoundsMode = BoundsMode.Stretch;
chart2.Size = new NSizeL(new NLength(100, NRelativeUnit.ParentPercentage), new NLength(50, NRelativeUnit.ParentPercentage));
NPointSeries point2 = new NPointSeries();
point2.DataLabelStyle.Visible = false;
GenerateXYData(point2);
chart2.Series.Add(point2);
// make sure they are aligned to the left
NSideGuideline guideline = new NSideGuideline();
guideline.Side = PanelSide.Left;
guideline.Targets.Add(chart1);
guideline.Targets.Add(chart2);
NThinChartControl1.document.RootPanel.Guidelines.Add(guideline);
// configure the x axis of the top chart to be slave of the x axis of the bottom chart
chart2.Axis(StandardAxis.PrimaryX).Slaves.Add(chart1.Axis(StandardAxis.PrimaryX));
chart2.Axis(StandardAxis.PrimaryX).ScrollBar.Visible = true;
// enable data zooming and scrolling
NThinChartControl1.Controller.SetActivePanel(chart2);
NDataZoomTool dzt = new NDataZoomTool();
dzt.AllowYAxisZoom = false;
NThinChartControl1.Controller.Tools.Add(dzt);
NThinChartControl1.Controller.Tools.Add(new NTooltipTool());
}
}
private void GenerateXYData(NPointSeries series)
{
for (int i = 0; i < 200; i++)
{
double u1 = Random.NextDouble();
double u2 = Random.NextDouble();
if (u1 == 0)
u1 += 0.0001;
if (u2 == 0)
u2 += 0.0001;
double z0 = 100 * Math.Sqrt(-2 * Math.Log(u1)) * Math.Cos(2 * Math.PI * u2);
double z1 = 100 * Math.Sqrt(-2 * Math.Log(u1)) * Math.Sin(2 * Math.PI * u2);
series.XValues.Add(z0);
series.Values.Add(z1);
series.InteractivityStyles.Add(i, new NInteractivityStyle("X: " + z0.ToString("0.00") + ", Y:" + z1.ToString("0.00")));
}
}
Hope this helps - let us know if you meet any problems or have any questions.
Best Regards,
Nevron Support Team