Changing Chart Configuration"
From Documentation
Raymondchao (talk | contribs) (Created page with "{{ZKChartsEssentialsPageHeader}} {{Template:UnderConstruction}} ZK Charts provides a set of comprehensive API for chart initial configuration, you can change the configuration ...") |
Raymondchao (talk | contribs) |
||
Line 21: | Line 21: | ||
// Set some attributes | // Set some attributes | ||
− | title.setText(" | + | title.setText("Yet another title"); |
− | title.setX( | + | title.setX(200); |
− | title.setY( | + | title.setY(400); |
// Assign title to chart | // Assign title to chart |
Revision as of 08:41, 5 March 2014
ZK Charts provides a set of comprehensive API for chart initial configuration, you can change the configuration very easy 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 object then modify its attrubutes 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 create a new Title 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 >