
This example demonstrates how to plot multiple data sets as multiple lines. ChartDirector allows each line to have different color, line width and dash styles.
This example also demonstrates how to set background colors and 3D borders for a chart, enable both vertical and horizontal grid lines, and add a legend box at the top of the chart.
- Set background color and 3D border for the chart using XYChart.XYChart.
- Enable both vertical and horizontal grid lines using XYChart.setPlotArea.
- Add a legend at the top of the chart using BaseChart.addLegend.
- Add an empty line layer using XYChart.addLineLayer2, then add multiple data sets to the line layer using Layer.addDataSet.
- Create a dash line color for a line using BaseChart.dashLineColor.
- Set the default line width for all lines in the layer using Layer.setLineWidth. (To set the line width for one particular line, use DataSet.setLineWidth.)