Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
238 views
in Technique[技术] by (71.8m points)

java - add scrollbar to JFreeChart 3DBarChart

Can I add a scroll bar to the JFreeChart that allows me horizontally move the bar ?

JFreeChart chart = ChartFactory.createBarChart3D(
    title, 
    "X",
    "Y",
    dataset, 
    PlotOrientation.VERTICAL, 
    true, 
    false, 
    false
);

Because the dataset could be very long that there's not enough width to show the result...

Can I use JSlide on it? or other methods?

If possible, please show me some sample code. Thank you!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

.Yes you can, if you have access to the JFreeChart demo code just modify SlidingCategoryDatasetDemo2 and replace createBarChart3D with createBarChart3D and you will get this:

3d Scrolling Chart

You will need to use a SlidingCategoryDataset. You can find the source code and demos here JFreeChart


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...