Render map when click on Chart plot. Fusioncharts

Recommended Posts

I want to render a Map using Fusioncharts when click on some plot in other Chart, so far i can not achieve this, how could i do that? I have the following code:

In code behind C#

Function that i want to display when click on other chart:

        public static void GraficaMundial(int id)
        { //some code here
            Chart sales = new Chart();

            // Setting chart id
            //sales.SetChartParameter(Chart.ChartParameter.chartId, "myChart3");

            // Setting chart type to world chart
            sales.SetChartParameter(Chart.ChartParameter.chartType, "worldwithcountries");

            // Setting chart width to 600px
            sales.SetChartParameter(Chart.ChartParameter.chartWidth, "100%");

            // Setting chart height to 350px
            sales.SetChartParameter(Chart.ChartParameter.chartHeight, "550");
            sales.SetChartParameter(Chart.ChartParameter.dataFormat, "json");
            sales.SetChartParameter(Chart.ChartParameter.dataSource, jsonData.ToString());

            var LtGraficoPaises = new Literal();

            LtGraficoPaises.Text = sales.Render();

   Code of the Chart that I would like the map to display

      private void GraficaEjecutivo()
        { //some code here

                StaticSource source = new StaticSource(chart);
                FusionCharts.DataEngine.DataModel model = new DataModel();
                var bar = new Charts.BarChart("scroll_chart_db");
                //bar.Scrollable = true;
                bar.ThemeName = FusionChartsTheme.ThemeName.FUSION;
                bar.Data.Source = model;
                bar.Caption.Text = "RFQ Totales por Ejecutivo";
                bar.SubCaption.Text = "2016-2017";
                bar.XAxis.Text = "Ejecutivos";
                bar.YAxis.Text = "Clientes";
                var funcion = @"function(eventObj, dataObj){

                document.getElementById('GraficoPaises').innerHTML =  PageMethods.GraficaMundial(1);
                bar.Events.AttachGenericEvents(FusionChartsEvents.GenericEvents.DATAPLOTCLICK, funcion.ToString());

                LtGraficoPorEjecutivo.Text = bar.Render();

In .aspx

Literal that render the Map

<div class="col-sm-12 text-center" id="GraficoPaises">
                        <asp:Literal ID="LtGraficoPaises" runat="server">

I did tests, and when i click on the bar of my chart (GraficaEjecutivo method) the event is working propertly, but im not be able to display or render my map.

What im doing wrong? I hope you can help me.

Share this post

Link to post
Share on other sites



To render maps on clicking the data plots of a chart, please check this sample for reference :

Also you can refer to the below sample link for the implementation code for the similar functionality in various technology stacks :




Share this post

Link to post
Share on other sites

Im trying to do this in c# but when i want to use configureLink i have the following error:

Uncaught TypeError: GraficaEjecutivos.configureLink is not a function

where GraficaEjecutivos is my id for my chart

MyFirstChart = new Chart("bar2d", "GraficaEjecutivos", "100%", "550", "json", jsonData.ToString());
          //Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "funcion", "MyFirstChart", true);
          var funcion = @"generarMapa = function (e) {
                          //let chart = '<%=MyFirstChart%>';
                          maptype = (;
                          renderAt: 'child-chart-container',
                          type: maptype
          MyFirstChart.AddEvent("dataplotClick", funcion.ToString());


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