Jump to content
JChartFX Community

Question

Hello,

I am a JChartFX licensed user. I am developing a product using JchartFX.

We have a situation where we have one dashboard and different charts in that. We need to filter or change data according to any event or something. Is there any facility in JChartFX to filter data on same charts?
More Explanation of  scenario : if you have one project dashboard containing lots of charts, what would you recommend we do to support more than one project?

Thanks in advance. 

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

You can modify any (or all) of the charts after any event captured on the client, e.g.

<body>
<select id="year" onchange="onYearChanged()">
<option value="1997">1997</option>    
<option value="1998">1998</option>    
<option value="1999">1999</option>    
</select><br/>
<div id="ChartDiv" style="width:550px;height:400px;display:inline-block"></div>
</body>

 

JavaScript

function onLoadDoc()
{
    chart1 = new cfx.Chart();
    chart1.setGallery(cfx.Gallery.Bar);
    chart1.setDataSource([10,12,8,9,11]);
    chart1.create("ChartDiv");
}

function onYearChanged()
{
    var selectObj = document.getElementById("year");
    if (selectObj.value == "1997")
        chart1.setDataSource([10,12,8,9,11]);
    else if (selectObj.value == "1998")
        chart1.setDataSource([8,7,12,14,11]);
    else
        chart1.setDataSource([3,4,8,1,12]);
}

Obviously instead of hardcoding data you would either request new data to the server or filter existing data, once you have the data you can invoke setDataSource on the chart to change its data, if necessary you can also change any of the charts visual attributes.

We do not offer any APIs to filter data

Regards,

JuanC

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×