how to make empty space in a line chart?
how can I achieve this?
How to get the spacing between null data which is show is the first image how to achieve this thing in this graph?
I think you can use two datasets. The line drawn from a dataset must be continuous.
@VinsonGuo answer may be useful but not elegant.
below is my advice:
If you want certain data not show in line chart,you can just edit library class LineChartRenderer .
eg:I add one code to show space when (int) e1.getX() %3 == 0
then I get below image.

@VinsonGuo answer may be useful but not elegant. below is my advice: If you want certain data not show in line chart,you can just edit library class
LineChartRenderer. eg:I add one code to show space when (int) e1.getX() %3 == 0then I get below image.
I cant seem to get this working, the line is not broken, its just joining the line between the gap.
Do you have example of code to check what options you are having for lines and chart?
Many thanks.
Its ok, I got it working. Found this way was good for me
add line to LineChartRenderer class at same position as @VinsonGuo above if (e1.getData() == null) continue;
When y value null, create entry like this
lineDataSet.addEntry( Entry(index, 0.0f,null))
Linechart will not draw the line.
Also works with live updating data, where you use "chart.moveViewToX" to scroll the data coming through.
@johnnyzen It's a good solution. However, I think we shouldn't alter the source code if we must do. In some cases, the gap of lines wouldn't be 3 or a fixed number, and these codes may affect other line charts that need a continuous line in the same project.
@VinsonGuo thanks. Yeah i know its not great in that sense, but with other solutions, like the "use two datasets" techique, using chart.moveViewToX when scrolling live data causes the lines to join together when a break is needed. I've no idea why this happens.
@johnnyzen It's a good solution. However, I think we shouldn't alter the source code if we must do. In some cases, the gap of lines wouldn't be 3 or a fixed number, and these codes may affect other line charts that need a continuous line in the same project.
I know what you mean.
We can create a new class extends LineChartRenderer,then just bind this render to our current chart,just like viewBinding.bubbleChart.renderer = heatMapChartRenderer.It can ensure the edited code won't affect other chart.
【明知道你是中国人,还要强行说英语感觉更累了,哈哈】