Closed hadiahmadi277 closed 2 years ago
With chart.getAxisSet().adjustRange();
the chart is set to its full x and y range. A good way to explore and play is the demo chart:
https://github.com/eclipse/swtchart/blob/develop/org.eclipse.swtchart.extensions.examples/src/org/eclipse/swtchart/extensions/examples/charts/DemoChart.java
Please pull the complete repository and import all projects into your workspace. Have a look at the bundle architecture of SWTChart: https://github.com/eclipse/swtchart/wiki
I receive and importe all the projects into the workspace, but the DemoChart.java gives such an error.
The following ChartType has been set using the auto-detection: LINE Exception in thread "main" java.lang.Error: Unresolved compilation problem:
at org.eclipse.swtchart.extensions.core.ResourceSupport.getImage(ResourceSupport.java:182)
at org.eclipse.swtchart.extensions.core.RangeSelector.createControl(RangeSelector.java:172)
at org.eclipse.swtchart.extensions.core.RangeSelector.<init>(RangeSelector.java:46)
at org.eclipse.swtchart.extensions.core.ScrollableChart.createRangeInfoUI(ScrollableChart.java:1419)
at org.eclipse.swtchart.extensions.core.ScrollableChart.createChart(ScrollableChart.java:1411)
at org.eclipse.swtchart.extensions.core.ScrollableChart.createChartSection(ScrollableChart.java:1350)
at org.eclipse.swtchart.extensions.core.ScrollableChart.initialize(ScrollableChart.java:1334)
at org.eclipse.swtchart.extensions.core.ScrollableChart.<init>(ScrollableChart.java:167)
at org.eclipse.swtchart.extensions.linecharts.LineChart.<init>(LineChart.java:62)
at org.eclipse.swtchart.customcharts.core.ChromatogramChart.<init>(ChromatogramChart.java:40)
at org.eclipse.swtchart.extensions.examples.parts.LineSeries_1_Part.<init>(LineSeries_1_Part.java:41)
at org.eclipse.swtchart.extensions.examples.charts.DemoChart.main(DemoChart.java:42)
Did you set the "Target Platform" correctly?
I do not understand what you mean. According to the instructions in this link, I put all the repositories in the workspace.
The "Target Platform" contains all necessary dependencies to run the dev environment. You have to load it in Eclipse:
https://github.com/eclipse/swtchart/blob/develop/org.eclipse.swtchart.targetplatform/org.eclipse.swtchart.targetplatform.target
Excuse me. I have not loaded the target platform yet. How can I use this code? Thank you
If you're using Eclipse, then read: https://www.vogella.com/tutorials/EclipseTargetPlatform/article.html
Otherwise, fetch the dependencies via Maven.
Thank you very much the problem was solved.
Is there an example that has pan capability?
And I did not see the zoom out feature in the demos
Have a look at the zoom out handler:
public class ZoomOutHandler extends AbstractChartMenuEntry implements IChartMenuEntry {
And I'm not sure what you mean with "pan capability"?
Pan means navigating the chart after zooming.
You can use the scrollbars, or the mouse scroll button. Have a look at the constraints to restrict scrolling either to only x or y. Both is activated by default:
https://github.com/eclipse/swtchart/blob/develop/org.eclipse.swtchart.extensions/src/org/eclipse/swtchart/extensions/core/RangeRestriction.java
I used the zoom and scroll chart codes based on the description of the following swtchart document, but it does not work. Is there a solution?