1
我想編程方式顯示加載後圖表中最後一個數據點的十字線和工具提示。下面的代碼是我到目前爲止。十字線顯示在正確的位置,但工具提示顯示向左的方向,太小而不適合文本。如何以編程方式顯示ShinobiChart十字線和工具提示?
int num = [self.activeTrendsResult sChart:self.activeChart numberOfDataPointsForSeriesAtIndex:0];
id<SChartData>data = [self.activeTrendsResult sChart:self.activeChart dataPointAtIndex:num-1 forSeriesAtIndex:0];
double x = [[data sChartXValue] doubleValue];
double y = [[data sChartYValue] doubleValue];
SChartPoint p;
p.x = x;
p.y = y;
[self.activeChart.crosshair moveToFloatingPosition:p onXAxis:self.activeChart.xAxis onYAxis:self.activeChart.yAxis];
[self.activeChart.crosshair.tooltip setResolvedDataPoint:p fromSeries:self.activeChart.series[0] fromChart:self.activeChart];
[self.activeChart.crosshair.tooltip setPosition:self.activeChart.crosshair.trackingPoint onCanvas:self.activeChart.canvas];
任何幫助將不勝感激。