简体   繁体   中英

JFree Chart with discontinuous series line charts

I am plotting XYChart range say 1 to 10 then 20 to 30 as series 1, and 11 to 19 as series 2. It looks straight forward to do it in JFreeChart serie1 (1,0), (10,0) (20, 0), (30, 0) and series2 (11, 0), (19, 0). The problem is that series 1 line connects values from 1 to 30 and thus overlap series 2. Is it possible to hide series 1 from 11 to 19. I can do it using more then two series but in that case it will look weird to have multiple series in the legends for two items. Many thanks for your help.

Thanks for your help. I did it this way. 这是我案例中的截图

To do the questioned task we need to add another point to the series, so in above case

series1 (1,0), (10,0), (10, null) (20, 0), (30, 0) series2 (11, 0), (19, 0)

(10, null) will break series 1 from 10 to 20. This way series 2 will occupy the space as shown in the figure for my case. Let me know if any one need further help.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM