timmolter/XChart — pull request #68 by mleoking (2014-04-27 09:08:50+00:00)
Title: Add load function

I have added a load function for Chart and StyleManager. The function basically can load values of multiple variables from a single string. The load function will call the setter function for a variable (e.g. setVariable(String sValue)) if it exists or otherwise use java reflection to set the value.

Here is an example:

chart.load("xAxisTitle=loaded x title SIN(width)+height:#SIN($width$)+$height$#;yAxisTitle=loaded y title;");

$xxx$ can be used to get variable values or get function returns, #xxxxx# can calculate expression.

I have written a small demo called LoadDemo in xchart-demo\src\main\java\com\xeiam\xchart\demo.

I am not sure if you like it. It might be able to help you write less lines of settings. Also the variables and expressions in load function are checked, and it will raise exceptions if there problems in the settings.