scatter plot with dates at x axis — add custom labels on X axis

前端 未结 3 990
梦如初夏
梦如初夏 2021-01-17 00:05

I want to have a scatter plot with dates in x-axis.

Because if I use ChartFactory.getTimeChartView I receive a line graph and the problem is:

3条回答
  •  悲哀的现实
    2021-01-17 00:38

    About scatter type of chart:

    Maybe you could just set proper parameters to XYSeriesRenderer:

    XYSeriesRenderer r = new XYSeriesRenderer();
    r.setColor(Color.GREEN);//green point
    r.setPointStyle(PointStyle.CIRCLE);//point in shape of circle
    r.setFillPoints(true);//enable points
    r.setLineWidth(0);//set line to 0 width - invisible
    mRenderer.addSeriesRenderer(r);
    

    and when you are calling factory:

    mChartView = ChartFactory.getTimeChartView(this, mDataset, mRenderer,"H:mm:ss");
    

    I'm aware that it is not clean and proper way, but I don't have android here to test it or to figure out more into details...

    I didn't test it, so give feed back to me please :).

    Hope it helps, Toni

提交回复
热议问题