1

I am using https://bgrins.github.io/spectrum/ colorpicker in one of my application where if user drags csv data to graph tab, then the data would be visualized as graph. The color of the graph can be changed by the user by choosing color in colorpicker. My problem is even for single dataset in the graph, there appears two color picker. Though i defined two colorpicker in div as

<div class="col-md-10">
                <canvas id="canvas">                    
                </canvas>
                <div id="js-legend" class="chart-legend"></div>
                <input  class="basic"/>
                <em id='basic-log'></em>
                <input  class="basic_compare"/>
                <em id='basic-log_compare'></em>
                <div id="graph_slider"></div>
                <div id="graph_legend"></div>


            </div>

I want to restrict if there is single data then there should be one colorpicker.The image attached below will make it clear. Showing two colorpicker for single dataset

Can i do something in below code not to show the second colorpicker icon if there is single dataset in canvas?

$("#graph").droppable({
                activeClass: "ui-state-default",
                hoverClass: "ui-state-hover",
                accept: ":not(.ui-sortable-helper)",
                drop: function (event, ui) {
                    HoldOn.open();
                    //alert(ui.draggable.text());
                    // $("#info").html("dropped!");
                    canvas = document.getElementById('canvas');
                    console.log(canvas);
                    if (canvas.toDataURL() === document.getElementById('blank').toDataURL())
                    {
                        data1 = ui.draggable.text();
Harnish
  • 101
  • 1
  • 10

0 Answers0