Hi Experts
I am creating a graph on the main X axis is a timeline, and on the second X axis is numbers for an easier way to get the point number on the graph (this numerical axis is the main graph, the time line is only needed to display to the user), so I have a problem when the numerical axis was not and was only temporal I created Trackball and showed X and Y coordinates of point on the entire graph, now that I added a new numerical axis and made it main Trackball shows only the first point coordinates.
chartControl1.Trackball.Visible = true;
chartControl1.Trackball.DisplayMode = TrackballTooltipDisplayMode.Float;
How can this be fixed?
|
Hi Dmitriy Shilin,
You can customize the trackball text with the help of TrackballTooltipRendering event of chart Trackball as per the below code example.
CodeSnippet:
Also, please find the sample from the below link and let us know if you have any further assistance.
Output:
|
Hi, thanks for your reply, the problem is solved but not exactly the way I wanted, I wanted the X axis to have numbers corresponding to the point index on the graph to find the point index on the graph more easily and quickly as I do point movement with the mouse, my problem is that Trackball does not follow the mouse pointer if the axis values have different types, I create the axes this way:
ChartAxis newXaxis = new ChartAxis();
newXaxis.GridLineType.ForeColor = Color.LightGray;
newXaxis.LineType.ForeColor = Color.LightGray;
newXaxis.ValueType = ChartValueType.DateTime;
newXaxis.RangeType = ChartAxisRangeType.Set;
newXaxis.DateTimeFormat = "HH:mm";
int addminX = AllData.measure[0].TimeStart.Minute % 15;
int addmaxX = (60 - AllData.measure[0].TimeEnd.Minute) % 15;
DateTime minX = AllData.measure[0].TimeStart.AddMinutes(-addminX).AddSeconds(-AllData.measure[0].TimeStart.Second);
DateTime maxX = AllData.measure[0].TimeEnd.AddMinutes(addmaxX).AddSeconds(-AllData.measure[0].TimeEnd.Second);
newXaxis.DateTimeRange = new ChartDateTimeRange(minX, maxX, 15, ChartDateTimeIntervalType.Minutes);
chartControl1.Axes.Add(newXaxis);
ChartAxis mainXaxis = new ChartAxis();
mainXaxis.OpposedPosition = true;
mainXaxis.GridLineType.ForeColor = Color.LightGray;
mainXaxis.LineType.ForeColor = Color.LightGray;
mainXaxis.ValueType = ChartValueType.Double;
mainXaxis.RangeType = ChartAxisRangeType.Set;
int minpoint = ((AllData.measure[0].TimeStart.Hour * 60 * 60 + AllData.measure[0].TimeStart.Minute * 60 + AllData.measure[0].TimeStart.Second) - (minX.Hour * 60 * 60 + minX.Minute * 60 + minX.Second)) / interval;
int maxpoint = (((maxX.Hour * 60 * 60 + maxX.Minute * 60 + maxX.Second) - (minX.Hour * 60 * 60 + minX.Minute * 60 + minX.Second)) / interval) - minpoint;
int separator = 15 * 60 / interval;
mainXaxis.Range = new MinMaxInfo(-minpoint, maxpoint, separator);
chartControl1.Axes.Add(mainXaxis);
//newXaxispoint.IsVisible = false;
.....
series.XAxis = mainXaxis;
for (int j = 0; j < AllData.measure[i].DataGraph.Count; j++)
{
series.Points.Add(j, AllData.measure[i].DataGraph[j]);
}
.....
I am also attaching a video to fully understand the problem.