Sign in to follow this  
xuen

Customize Empty Data Message

Recommended Posts

Hi,

 

I have issue on customize the empty data message in Javascript Chart at code behind.

 

My code as below:

 

string chart = "<chart></chart>";

FusionCharts.SetRenderer("javascript");

FusionCharts.SetConfiguration("ChartNoDataText", "Please select a record above");

div_testing.Text = FusionCharts.RenderChart("../FusionCharts/MSBar2D.swf", "", chart, "ms_bar_testing", "450", "700", false, false);

 

After the chart is rendered, the chart still showing the default value which is "No data to display." instead of "Please select a record above".

 

 

Please help.

Edited by xuen

Share this post


Link to post
Share on other sites

Anyone can help?

 

 

Hi,

 

I have issue on customize the empty data message in Javascript Chart at code behind.

 

My code as below:

 

string chart = "<chart></chart>";

FusionCharts.SetRenderer("javascript");

FusionCharts.SetConfiguration("ChartNoDataText", "Please select a record above");

div_testing.Text = FusionCharts.RenderChart("../FusionCharts/MSBar2D.swf", "", chart, "ms_bar_testing", "450", "700", false, false);

 

After the chart is rendered, the chart still showing the default value which is "No data to display." instead of "Please select a record above".

 

 

Please help.

Share this post


Link to post
Share on other sites
Guest Sumedh

Hi,

 

You can change the chart message using standard JavaScript method "configure" provided by FusionCharts JavaScript API.

 

You would need to call "configure" method on the chart variable in .aspx page.

 

Ref. Code:

 

<form id="form1" runat="server">

<div style="padding:40px; background-color:#DCDCDC; border:1px solid #DCDCDC; width: 600px;">

<asp:Literal ID="Literal1" runat="server"></asp:Literal>

<script type="text/javascript">

var myChart = FusionCharts("myFirst");

myChart.configure("ChartNoDataText", "Please select a record above.");

</script>

</div>

</form>

 

Please find attached illustration for your reference.

MSColumn3D.zip

Share this post


Link to post
Share on other sites

Hi,

 

Thanks for the solution but the customize message can only load for first time.

Scenario:

1. Frist load no data return with the filtering value I enter. The customize message can be show.

2. Click on Search button again with the filtering value, Default message is show instead of the customize message.

 

Info:

My <asp:literal> will control by the ajax loader.

<telerik:ajaxsetting ajaxcontrolid="btnSearch">

<updatedcontrols>

<telerik:ajaxupdatedcontrol controlid="div_testing" />

</updatedcontrols>

</telerik:ajaxsetting>

 

<fieldset id="fsTesting" >

<legend >Testing</legend>

<center>

<asp:literal id="div_testing" runat="server"></asp:literal>

<script type="text/javascript">

var testChart = FusionCharts("col_testing");

testChart.configure("ChartNoDataText", "Please select a record above. col_aoc_int");

</script>

</center>

</fieldset>

 

 

Please help.

Thanks in advanced.

 

Hi,

 

You can change the chart message using standard JavaScript method "configure" provided by FusionCharts JavaScript API.

 

You would need to call "configure" method on the chart variable in .aspx page.

 

Ref. Code:

 

<form id="form1" runat="server">

<div style="padding:40px; background-color:#DCDCDC; border:1px solid #DCDCDC; width: 600px;">

<asp:Literal ID="Literal1" runat="server"></asp:Literal>

<script type="text/javascript">

var myChart = FusionCharts("myFirst");

myChart.configure("ChartNoDataText", "Please select a record above.");

</script>

</div>

</form>

 

Please find attached illustration for your reference.

Edited by xuen

Share this post


Link to post
Share on other sites

Hi,

 

Anyone can help?

 

 

Thanks in advanced.

 

 

Hi,

 

Thanks for the solution but the customize message can only load for first time.

Scenario:

1. Frist load no data return with the filtering value I enter. The customize message can be show.

2. Click on Search button again with the filtering value, Default message is show instead of the customize message.

 

Info:

My <asp:literal> will control by the ajax loader.

<telerik:ajaxsetting ajaxcontrolid="btnSearch">

<updatedcontrols>

<telerik:ajaxupdatedcontrol controlid="div_testing" />

</updatedcontrols>

</telerik:ajaxsetting>

 

<fieldset id="fsTesting" >

<legend >Testing</legend>

<center>

<asp:literal id="div_testing" runat="server"></asp:literal>

<script type="text/javascript">

var testChart = FusionCharts("col_testing");

testChart.configure("ChartNoDataText", "Please select a record above. col_aoc_int");

</script>

</center>

</fieldset>

 

 

Please help.

Thanks in advanced.

 

 

Share this post


Link to post
Share on other sites
Guest Sumedh

Hi,

 

You would have to create a function. in this function, you would need to write the "chart message" code.

 

And call this function inside the Page_Load page as well as inside the Search button's code.

 

Hope this helps!

Share this post


Link to post
Share on other sites

Hi,

 

The function you mean is javascript function or code behind function?

 

Can you provide the sample?

 

Thanks.

 

 

 

Hi,

 

You would have to create a function. in this function, you would need to write the "chart message" code.

 

And call this function inside the Page_Load page as well as inside the Search button's code.

 

Hope this helps!

Share this post


Link to post
Share on other sites

Hi,

 

Any update?

 

 

Hi,

 

The function you mean is javascript function or code behind function?

 

Can you provide the sample?

 

Thanks.

 

 

 

 

Share this post


Link to post
Share on other sites
Guest Sumedh

Hi,

 

There is no sample for this type of scenario, you would have to write your own logic for this.

Share this post


Link to post
Share on other sites

Hi,

 

If no sample, how do you know create a function and call in Page_load and Search Button is working?

 

 

 

Hi,

 

There is no sample for this type of scenario, you would have to write your own logic for this.

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
Sign in to follow this