This example demonstrates the basic steps in creating bar charts.
- Create an XYChart object using XYChart.XYChart.
- Specify the plot area of the chart using XYChart.setPlotArea. The plot area is the rectangle bounded by the x and y axes. You should leave some margin on the outside of the plot area for axis labels, chart titles, etc.
- Specify the labels on the x-axis using Axis.setLabels.
- Add a bar layer and specify the data for the bars using XYChart.addBarLayer.
- Pass the chart to the CChartViewer for display using CChartViewer.setChart (MFC version) or QChartViewer.setChart (Qt version), or generate the chart as an image file using BaseChart.makeChart (Command Line version).
- Generate tool tips for the chart using BaseChart.getHTMLImageMap. (MFC/Qt version)