public final class Curve extends java.lang.Object implements IExtension, IGallery
Provides access to the Curve gallery object.
Curve charts will use a spline algorithm to draw a curve between the points in the chart, rather than connecting the points directly with a straight line. Just as lines, curves also expose an extensive API to configure the curve color width and markers.
The methods of the Curve
class allow you to customize the visual attributes of a Curve chart. In order to make the supported members available, you must first set the gallery of the chart to Curve, and cast the setGalleryAttributes
method of the Chart to the Curve
class:
chart1.setGallery(Gallery.CURVE); Curve curve; curve = ((Curve)chart1.getGalleryAttributes());
The cast will fail if the gallery is not set to Curve.
Once you have done this, using the newly created object you can assign these special attributes for the Curve gallery type in your chart.
PopulateCarProduction(chart1);
chart1.getTitles().add(new TitleDockable("Vehicles Production by Type"));
chart1.setGallery(Gallery.CURVE);
public static void PopulateCarProduction(Chart chart1) { CarProduction[] production = new CarProduction[] { new CarProduction("Jan", 1760, 535, 695 ) , new CarProduction("Feb", 1849, 395, 688 ) , new CarProduction("Mar", 2831, 685, 1047 ) , new CarProduction("Apr", 2851, 984, 1652 ) , new CarProduction("May", 2961, 1579, 1889 ) , new CarProduction("Jun", 1519, 1539, 1766 ) , new CarProduction("Jul", 2633, 1489, 1361 ) , new CarProduction("Aug", 1140, 650, 874 ) , new CarProduction("Sep", 1626, 653, 693 ) , new CarProduction("Oct", 1478, 2236, 786 ) , new CarProduction("Nov", 1306, 1937, 599 ) , new CarProduction("Dec", 1607, 2138, 678 ) }; ObjectProvider objProvider = new ObjectProvider(production); chart1.getDataSourceSettings().setDataSource(objProvider); }
public static class CarProduction { private CarProduction(String month, int sedan, int coupe, int SUV) { this.setMonth(month); this.setSedan(sedan); this.setCoupe(coupe); this.setSUV(SUV); } private String privateMonth; public final String getMonth() { return privateMonth; } public final void setMonth(String value) { privateMonth = value; } private int privateSedan; public final int getSedan() { return privateSedan; } public final void setSedan(int value) { privateSedan = value; } private int privateCoupe; public final int getCoupe() { return privateCoupe; } public final void setCoupe(int value) { privateCoupe = value; } private int privateSUV; public final int getSUV() { return privateSUV; } public final void setSUV(int value) { privateSUV = value; } }
Constructor and Description |
---|
Curve()
Constructs a newly allocated Curve object
|
Modifier and Type | Method and Description |
---|---|
VectorCurveValue |
getTemplate()
Description goes here
|
java.lang.String |
getTemplateString()
Description goes here
|
VectorCurveTemplate |
getTemplateVectorCurveTemplate()
Description goes here
|
float |
getTension()
Gets or sets the Tension variable for the Cubic Spline curve algorithm.
|
boolean |
isNative()
Description goes here
|
void |
resetTemplate()
Set the property Template to its default value.
|
void |
resetTension()
Set the property Tension to its default value.
|
void |
setNative(boolean value)
Description goes here
|
void |
setTemplate(java.lang.String value)
Description goes here
|
void |
setTemplate(VectorCurveTemplate value)
Description goes here
|
void |
setTemplate(VectorCurveValue value)
Description goes here
|
void |
setTension(float value)
Gets or sets the Tension variable for the Cubic Spline curve algorithm.
|
public boolean isNative()
public void setNative(boolean value)
value
- public VectorCurveTemplate getTemplateVectorCurveTemplate()
Description goes here
resetTemplate
public void setTemplate(VectorCurveTemplate value)
Description goes here
value
- resetTemplate
public VectorCurveValue getTemplate()
Description goes here
resetTemplate
public void setTemplate(VectorCurveValue value)
Description goes here
value
- resetTemplate
public java.lang.String getTemplateString()
Description goes here
resetTemplate
public void setTemplate(java.lang.String value)
Description goes here
value
- resetTemplate
public float getTension()
Gets or sets the Tension variable for the Cubic Spline curve algorithm.
To access this method a Curve
getGalleryAttributes
object need to be created.
Using this method, you can create curves series drawn with 'loose' or 'tight' tension value. Think of the curve series as points connected by a rope. As you increase tension on the rope, the curves become more 'tight'. Decreasing the tension creates a more 'loose' looping curve.
Below, a chart with its Tension for the curve set to 1.0:
PopulateCarProduction(chart1); chart1.setGallery(Gallery.CURVE); Curve curve; curve = ((Curve)chart1.getGalleryAttributes()); curve.setTension(1f); chart1.getTitles().add(new TitleDockable("Vehicles Production by Type")); chart1.getAxisY().setMin(0); chart1.getAxisY().setMax(3300);
public static void PopulateCarProduction(Chart chart1) { CarProduction[] production = new CarProduction[] { new CarProduction("Jan", 1760, 535, 695 ) , new CarProduction("Feb", 1849, 395, 688 ) , new CarProduction("Mar", 2831, 685, 1047 ) , new CarProduction("Apr", 2851, 984, 1652 ) , new CarProduction("May", 2961, 1579, 1889 ) , new CarProduction("Jun", 1519, 1539, 1766 ) , new CarProduction("Jul", 2633, 1489, 1361 ) , new CarProduction("Aug", 1140, 650, 874 ) , new CarProduction("Sep", 1626, 653, 693 ) , new CarProduction("Oct", 1478, 2236, 786 ) , new CarProduction("Nov", 1306, 1937, 599 ) , new CarProduction("Dec", 1607, 2138, 678 ) }; ObjectProvider objProvider = new ObjectProvider(production); chart1.getDataSourceSettings().setDataSource(objProvider); }
public static class CarProduction { private CarProduction(String month, int sedan, int coupe, int SUV) { this.setMonth(month); this.setSedan(sedan); this.setCoupe(coupe); this.setSUV(SUV); } private String privateMonth; public final String getMonth() { return privateMonth; } public final void setMonth(String value) { privateMonth = value; } private int privateSedan; public final int getSedan() { return privateSedan; } public final void setSedan(int value) { privateSedan = value; } private int privateCoupe; public final int getCoupe() { return privateCoupe; } public final void setCoupe(int value) { privateCoupe = value; } private int privateSUV; public final int getSUV() { return privateSUV; } public final void setSUV(int value) { privateSUV = value; } }
resetTension
public void setTension(float value)
Gets or sets the Tension variable for the Cubic Spline curve algorithm.
To access this method a Curve
getGalleryAttributes
object need to be created.
Using this method, you can create curves series drawn with 'loose' or 'tight' tension value. Think of the curve series as points connected by a rope. As you increase tension on the rope, the curves become more 'tight'. Decreasing the tension creates a more 'loose' looping curve.
Below, a chart with its Tension for the curve set to 1.0:
PopulateCarProduction(chart1); chart1.setGallery(Gallery.CURVE); Curve curve; curve = ((Curve)chart1.getGalleryAttributes()); curve.setTension(1f); chart1.getTitles().add(new TitleDockable("Vehicles Production by Type")); chart1.getAxisY().setMin(0); chart1.getAxisY().setMax(3300);
public static void PopulateCarProduction(Chart chart1) { CarProduction[] production = new CarProduction[] { new CarProduction("Jan", 1760, 535, 695 ) , new CarProduction("Feb", 1849, 395, 688 ) , new CarProduction("Mar", 2831, 685, 1047 ) , new CarProduction("Apr", 2851, 984, 1652 ) , new CarProduction("May", 2961, 1579, 1889 ) , new CarProduction("Jun", 1519, 1539, 1766 ) , new CarProduction("Jul", 2633, 1489, 1361 ) , new CarProduction("Aug", 1140, 650, 874 ) , new CarProduction("Sep", 1626, 653, 693 ) , new CarProduction("Oct", 1478, 2236, 786 ) , new CarProduction("Nov", 1306, 1937, 599 ) , new CarProduction("Dec", 1607, 2138, 678 ) }; ObjectProvider objProvider = new ObjectProvider(production); chart1.getDataSourceSettings().setDataSource(objProvider); }
public static class CarProduction { private CarProduction(String month, int sedan, int coupe, int SUV) { this.setMonth(month); this.setSedan(sedan); this.setCoupe(coupe); this.setSUV(SUV); } private String privateMonth; public final String getMonth() { return privateMonth; } public final void setMonth(String value) { privateMonth = value; } private int privateSedan; public final int getSedan() { return privateSedan; } public final void setSedan(int value) { privateSedan = value; } private int privateCoupe; public final int getCoupe() { return privateCoupe; } public final void setCoupe(int value) { privateCoupe = value; } private int privateSUV; public final int getSUV() { return privateSUV; } public final void setSUV(int value) { privateSUV = value; } }
value
- resetTension
public void resetTemplate()
setTemplate
public void resetTension()
setTension
2014 Software FX, Inc. All Rights Reserved. Chart FX is a registered trademark of Software FX, Inc
All other names are trademarks or registered trademarks of their respective owners.