jQWidgets Forums

jQuery UI Widgets Forums Chart jqWidgets chart legend disable click event

This topic contains 1 reply, has 2 voices, and was last updated by  Stanislav 7 years, 10 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author

  • PratapCh
    Participant

    Hi
    Is there any way to disable the click event of chart legend series items.

    As of now when we click on series legend item, it is removing the series item from chart. Basically I need to show the legend and user should not allow to disable series items in chart.

    Let me know if you need any more details, happy to provide.

    Thanks


    Stanislav
    Participant

    Hello PratapCh,

    You can use enableSeriesToggle. This disables clicking on the boxes or the whole legend bar overall.
    If you have more than one element displayed, you need to set this property individually to every single one of them.
    Here is an example:

    var sampleData = [{
         a: 0.35,
         b: 14.5
     }, {
         a: 1,
         b: 2.5
     }, {
         a: 10,
         b: 0.2
     }, {
         a: 100,
         b: 205
     }, {
         a: 1,
         b: 100
     }, {
         a: 5.11,
         b: 10.13
     }, {
         a: 20.13,
         b: 10.13
     }, {
         a: 600,
         b: 300
     }];
     var settings = {
         title: "Logarithmic Scale Axis Example",
         description: "Sample logarithmic scale axis with base 2",
         padding: {
             left: 5,
             top: 5,
             right: 5,
             bottom: 5
         },
         titlePadding: {
             left: 0,
             top: 0,
             right: 0,
             bottom: 10
         },
         source: sampleData,
         enableAnimations: true,
         categoryAxis: {
             dataField: '',
             description: '',
             showGridLines: true,
             showTickMarks: true
         },
         seriesGroups: [{
             type: 'column',
             valueAxis: {
                 description: 'Value',
                 logarithmicScale: true,
                 logarithmicScaleBase: 2,
                 unitInterval: 1,
                 tickMarksInterval: 1,
                 gridLinesInterval: 1,
                 formatSettings: {
                     decimalPlaces: 3
                 },
    
                 horizontalTextAlignment: 'right'
             },
             series: [{
                 dataField: 'a',
                 displayText: 'A',
                 enableSeriesToggle: false
             }, {
                 dataField: 'b',
                 displayText: 'B',
                 enableSeriesToggle: false
             }]
         }]
     };
     $('#jqxChart').jqxChart(settings);

    Best Regards,
    Stanislav

    JQWidgets Team
    http://www.jqwidgets.com

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

You must be logged in to reply to this topic.