Wanted to plot only one spline at the chart load and further add other splines after loading










0















Main multispline chart



HI All, as shown in the image, I am plotting multispline chart using highcharts. What I want is to plot only 'a' while loading the chart and the rest will be invisible and I could add them later like this Higcharts Spline (only one).
Thank you in advance.
This previous answered question partly working in my case but I don't want to hide all the series. I want to have one visible series.










share|improve this question




























    0















    Main multispline chart



    HI All, as shown in the image, I am plotting multispline chart using highcharts. What I want is to plot only 'a' while loading the chart and the rest will be invisible and I could add them later like this Higcharts Spline (only one).
    Thank you in advance.
    This previous answered question partly working in my case but I don't want to hide all the series. I want to have one visible series.










    share|improve this question


























      0












      0








      0








      Main multispline chart



      HI All, as shown in the image, I am plotting multispline chart using highcharts. What I want is to plot only 'a' while loading the chart and the rest will be invisible and I could add them later like this Higcharts Spline (only one).
      Thank you in advance.
      This previous answered question partly working in my case but I don't want to hide all the series. I want to have one visible series.










      share|improve this question
















      Main multispline chart



      HI All, as shown in the image, I am plotting multispline chart using highcharts. What I want is to plot only 'a' while loading the chart and the rest will be invisible and I could add them later like this Higcharts Spline (only one).
      Thank you in advance.
      This previous answered question partly working in my case but I don't want to hide all the series. I want to have one visible series.







      highcharts






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 14 '18 at 21:06







      admpec

















      asked Nov 14 '18 at 20:32









      admpecadmpec

      54




      54






















          1 Answer
          1






          active

          oldest

          votes


















          0














          You can use Highcharts.Chart.addSeries() method to add additional series dynamically:



          Html:



          <script src="https://code.highcharts.com/highcharts.js"></script>

          <div id="container"></div>
          <button id="btn">Add series</button>


          JS:



          let data = [
          name: 'Installation',
          data: [43934, 52503, 57177, 69658, 97031, 119931, 137133, 154175]
          ,
          name: 'Manufacturing',
          data: [24916, 24064, 29742, 29851, 32490, 30282, 38121, 40434]
          ,
          name: 'Sales & Distribution',
          data: [11744, 17722, 16005, 19771, 20185, 24377, 32147, 39387]
          ,
          name: 'Project Development',
          data: [null, null, 7988, 12169, 15112, 22452, 34400, 34227]
          ,
          name: 'Other',
          data: [12908, 5948, 8105, 11248, 8989, 11816, 18274, 18111]
          ];

          let btn = document.querySelector('#btn');
          let i = 1;

          btn.addEventListener('click', () =>
          if (i < data.length)
          chart.addSeries(data[i]);
          i++;

          );

          let chart = Highcharts.chart('container',
          chart:
          type: 'spline'
          ,
          plotOptions:
          series:
          marker:
          enabled: false
          ,
          pointStart: 2010

          ,
          series: [
          data[0]
          ]
          );


          Demo:
          https://jsfiddle.net/BlackLabel/rtsznykp/3/






          share|improve this answer






















            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53308314%2fwanted-to-plot-only-one-spline-at-the-chart-load-and-further-add-other-splines-a%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            You can use Highcharts.Chart.addSeries() method to add additional series dynamically:



            Html:



            <script src="https://code.highcharts.com/highcharts.js"></script>

            <div id="container"></div>
            <button id="btn">Add series</button>


            JS:



            let data = [
            name: 'Installation',
            data: [43934, 52503, 57177, 69658, 97031, 119931, 137133, 154175]
            ,
            name: 'Manufacturing',
            data: [24916, 24064, 29742, 29851, 32490, 30282, 38121, 40434]
            ,
            name: 'Sales & Distribution',
            data: [11744, 17722, 16005, 19771, 20185, 24377, 32147, 39387]
            ,
            name: 'Project Development',
            data: [null, null, 7988, 12169, 15112, 22452, 34400, 34227]
            ,
            name: 'Other',
            data: [12908, 5948, 8105, 11248, 8989, 11816, 18274, 18111]
            ];

            let btn = document.querySelector('#btn');
            let i = 1;

            btn.addEventListener('click', () =>
            if (i < data.length)
            chart.addSeries(data[i]);
            i++;

            );

            let chart = Highcharts.chart('container',
            chart:
            type: 'spline'
            ,
            plotOptions:
            series:
            marker:
            enabled: false
            ,
            pointStart: 2010

            ,
            series: [
            data[0]
            ]
            );


            Demo:
            https://jsfiddle.net/BlackLabel/rtsznykp/3/






            share|improve this answer



























              0














              You can use Highcharts.Chart.addSeries() method to add additional series dynamically:



              Html:



              <script src="https://code.highcharts.com/highcharts.js"></script>

              <div id="container"></div>
              <button id="btn">Add series</button>


              JS:



              let data = [
              name: 'Installation',
              data: [43934, 52503, 57177, 69658, 97031, 119931, 137133, 154175]
              ,
              name: 'Manufacturing',
              data: [24916, 24064, 29742, 29851, 32490, 30282, 38121, 40434]
              ,
              name: 'Sales & Distribution',
              data: [11744, 17722, 16005, 19771, 20185, 24377, 32147, 39387]
              ,
              name: 'Project Development',
              data: [null, null, 7988, 12169, 15112, 22452, 34400, 34227]
              ,
              name: 'Other',
              data: [12908, 5948, 8105, 11248, 8989, 11816, 18274, 18111]
              ];

              let btn = document.querySelector('#btn');
              let i = 1;

              btn.addEventListener('click', () =>
              if (i < data.length)
              chart.addSeries(data[i]);
              i++;

              );

              let chart = Highcharts.chart('container',
              chart:
              type: 'spline'
              ,
              plotOptions:
              series:
              marker:
              enabled: false
              ,
              pointStart: 2010

              ,
              series: [
              data[0]
              ]
              );


              Demo:
              https://jsfiddle.net/BlackLabel/rtsznykp/3/






              share|improve this answer

























                0












                0








                0







                You can use Highcharts.Chart.addSeries() method to add additional series dynamically:



                Html:



                <script src="https://code.highcharts.com/highcharts.js"></script>

                <div id="container"></div>
                <button id="btn">Add series</button>


                JS:



                let data = [
                name: 'Installation',
                data: [43934, 52503, 57177, 69658, 97031, 119931, 137133, 154175]
                ,
                name: 'Manufacturing',
                data: [24916, 24064, 29742, 29851, 32490, 30282, 38121, 40434]
                ,
                name: 'Sales & Distribution',
                data: [11744, 17722, 16005, 19771, 20185, 24377, 32147, 39387]
                ,
                name: 'Project Development',
                data: [null, null, 7988, 12169, 15112, 22452, 34400, 34227]
                ,
                name: 'Other',
                data: [12908, 5948, 8105, 11248, 8989, 11816, 18274, 18111]
                ];

                let btn = document.querySelector('#btn');
                let i = 1;

                btn.addEventListener('click', () =>
                if (i < data.length)
                chart.addSeries(data[i]);
                i++;

                );

                let chart = Highcharts.chart('container',
                chart:
                type: 'spline'
                ,
                plotOptions:
                series:
                marker:
                enabled: false
                ,
                pointStart: 2010

                ,
                series: [
                data[0]
                ]
                );


                Demo:
                https://jsfiddle.net/BlackLabel/rtsznykp/3/






                share|improve this answer













                You can use Highcharts.Chart.addSeries() method to add additional series dynamically:



                Html:



                <script src="https://code.highcharts.com/highcharts.js"></script>

                <div id="container"></div>
                <button id="btn">Add series</button>


                JS:



                let data = [
                name: 'Installation',
                data: [43934, 52503, 57177, 69658, 97031, 119931, 137133, 154175]
                ,
                name: 'Manufacturing',
                data: [24916, 24064, 29742, 29851, 32490, 30282, 38121, 40434]
                ,
                name: 'Sales & Distribution',
                data: [11744, 17722, 16005, 19771, 20185, 24377, 32147, 39387]
                ,
                name: 'Project Development',
                data: [null, null, 7988, 12169, 15112, 22452, 34400, 34227]
                ,
                name: 'Other',
                data: [12908, 5948, 8105, 11248, 8989, 11816, 18274, 18111]
                ];

                let btn = document.querySelector('#btn');
                let i = 1;

                btn.addEventListener('click', () =>
                if (i < data.length)
                chart.addSeries(data[i]);
                i++;

                );

                let chart = Highcharts.chart('container',
                chart:
                type: 'spline'
                ,
                plotOptions:
                series:
                marker:
                enabled: false
                ,
                pointStart: 2010

                ,
                series: [
                data[0]
                ]
                );


                Demo:
                https://jsfiddle.net/BlackLabel/rtsznykp/3/







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 15 '18 at 7:46









                Wojciech ChmielWojciech Chmiel

                1,9661210




                1,9661210





























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53308314%2fwanted-to-plot-only-one-spline-at-the-chart-load-and-further-add-other-splines-a%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    這個網誌中的熱門文章

                    How to read a connectionString WITH PROVIDER in .NET Core?

                    In R, how to develop a multiplot heatmap.2 figure showing key labels successfully

                    Museum of Modern and Contemporary Art of Trento and Rovereto