jQuery UI Widgets Forums Chart Clear chart

Tagged: , ,

This topic contains 6 replies, has 3 voices, and was last updated by  Peter Stoev 9 years, 5 months ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Clear chart Posts
  • Clear chart #75089

    ziggy
    Participant

    Hi,

    Is there a function to clear chart?

    Thanks and regards.

    Clear chart #75103

    ivailo
    Participant

    Hi Karen,

    There is no built in function, but like a workaround you can set 0 for all values an then to update.

    Best Regards,
    Ivailo Ivanov

    jQWidgets Team
    http://www.jqwidgets.com

    Clear chart #75104

    ziggy
    Participant

    Hi Ivailo,

    What do you mean 0 for all values?

    Like this?

    $('#jqxGraphViewProcessAlign').jqxChart({
                        source: 0,
                        xAxis:
                        {
                            type: 0,
                            baseUnit: 0,
                            dataField: 0,
                            valuesOnTicks: 0,
                            unitInterval: 0,
                            tickMarks: 0,
                            axisSize:0,
                            minValue: 0,
                            maxValue: 0,
                            labels:
                            {
                                angle: 30,
                                horizontalAlignment: 'left',
                                verticalAlignment: 'center',
                                rotationPoint: 'left',
                                offset: { y: -30 },
                                formatFunction: function(value)
                                {
                                    return  $.jqx.dataFormat.formatDate(value, 'dd-MMM-yyyy HH:ss');
                                }
                            }
                        }
                    });  
    Clear chart #75107

    ivailo
    Participant

    Hi Karen,

    Set your data source with 0 values.

    Best Regards,
    Ivailo Ivanov

    jQWidgets Team
    http://www.jqwidgets.com

    Clear chart #75109

    ziggy
    Participant

    Hi Ivailo,

    When I set the source to an empty array, I get the following error:

    Error: Invalid value for <rect> attribute y="NaN"

    Is there a cleaner way to clear the charts? An example would be a great help.

    Thanks!

    Clear chart #75121

    ivailo
    Participant

    Hi Karen,

    Set the valus of your data source like this.

    var data = [{
             a: 0,
             b: 0,
             c: ...
         }]

    Then update.
    Here is a bit modified update demo for visualization.

    Best Regards,
    Ivailo Ivanov

    jQWidgets Team
    http://www.jqwidgets.com

    Clear chart #75132

    Peter Stoev
    Keymaster

    Hi Karen,

    You can also try:

       $('#chartContainer').jqxChart('seriesGroups', []);
    

    Best Regards,
    Peter Stoev
    jQWidgets Team
    http://www.jqwidgets.com

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.