Changing Chart Configuration"

From Documentation
Line 1: Line 1:
 
{{ZKChartsEssentialsPageHeader}}
 
{{ZKChartsEssentialsPageHeader}}
  
ZK Charts provides a set of comprehensive API for chart initial configuration, you can change the configuration very easily by simply calling API. For example, if we want to change the title's configuration, we can call <tt>chart.getTitle()</tt> method to get the <tt>Title</tt> object then modify its attributes as below:
+
ZK Charts provides a set of comprehensive API for chart initial configuration, you can change the configuration very easily by simply calling API. For example, if we want to change the title's configuration, we can call <tt>chart.getTitle()</tt> method to get the <javadoc directory="zkcharts">org.zkoss.chart.Title</javadoc> class then modify its attributes as below:
 
<source lang="java">
 
<source lang="java">
 
     // Get the title option of chart
 
     // Get the title option of chart
Line 12: Line 12:
 
</source>
 
</source>
  
Of course you can also create a new <tt>Title</tt> and assign it to chart:
+
Of course you can also create a new <javadoc directory="zkcharts">org.zkoss.chart.Title</javadoc> class and assign it to chart:
  
 
<source lang="java">
 
<source lang="java">

Revision as of 08:04, 11 March 2014

Changing Chart Configuration


ZK Charts provides a set of comprehensive API for chart initial configuration, you can change the configuration very easily by simply calling API. For example, if we want to change the title's configuration, we can call chart.getTitle() method to get the Title class then modify its attributes as below:

    // Get the title option of chart
    Title title = chart.getTitle();

    // Set some attributes
    title.setText("It's a title");
    title.setX(100);
    title.setY(250);

Of course you can also create a new Title class and assign it to chart:

    // Create a new Title
    Title title = new Title();

    // Set some attributes
    title.setText("Yet another title");
    title.setX(200);
    title.setY(400);

    // Assign title to chart
    chart.setTitle(title);

< Get Complete Source Code of This Book >


Last Update : 2014/03/11

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.