[CLOSED] Disable Line Series Tips

  1. #1

    [CLOSED] Disable Line Series Tips

    This is related to the post on Toggling VerticalMarkers that Baidaly was able to help on.

    I have created my chart in behind code, including chart tips:

    //Partial code
    Chart byMonthChart = new Chart();
    ..
    VerticalMarker vm = new VerticalMarker();
    vm.Snap = true;
    vm.ShowXLabel = true;
    byMonthChart.Plugins.Add(vm);
    ...
    LineSeries lSeries = new LineSeries();
    ...
    lSeries.Tips = new ChartTip();
    lSeries.Tips.TrackMouse = true;
    lSeries.Tips.BodyStyle = "text-align:center; fount-size:9px;";
    lSeries.Tips.Renderer.Handler = "this.update('<b>' + storeItem.get('Name') + ' ' + 
         item.series.title + '<br/>Requests</b><hr><font color=blue>' + 
         String(item.value[1]) + '</font>');
    
    byMonthChart.Series.Add(lSeries);
    ...
    I have added CheckBoxItems to the charts context menu that would allow the user to toggle the VerticleMarker and ChartTips on or off.

    Question: Is it possible to disable/enable/hide the line series tips via javascript?
    Last edited by Daniil; Jun 19, 2013 at 4:51 PM. Reason: [CLOSED]
  2. #2
    Hi Chris,

    I can suggest the following solution.

    Disable
    var series = App.Chart1.series.items[0];
    
    series.originalTooltip = series.tooltip;
    delete series.tooltip;
    Enable
    var series = App.Chart1.series.items[0];
    
    series.tooltip = series.originalTooltip;
    delete series.originalTooltip;
  3. #3
    Didn't even occur to me to just move it to a temp variable and move it back. Perfect, very simple. Please close the thread.

    Here is my final code to loop through all the series:
    function chartTips (me, checked) {
    
       var chart = Ext.getCmp('CrtsChart');
    
       for (var i=0; i<chart.series.length; i++) {
    
          var series = chart.series.items[i];
    
          if (checked === false) {
             series.origTooltip = series.tooltip;
             delete series.tooltip;
          }
          else {
             series.tooltip = series.origTooltip;
             delete series.origTooltip;
          }
       }
    }
    Last edited by cwolcott; Jun 19, 2013 at 4:42 PM.

Similar Threads

  1. [CLOSED] Renderer on Tips of Series of Chart in code behind
    By reinout.mechant@imprss.be in forum 2.x Legacy Premium Help
    Replies: 5
    Last Post: Jun 21, 2013, 3:29 PM
  2. How to use Line series Chart in version 1.3
    By Binai in forum 1.x Help
    Replies: 1
    Last Post: May 08, 2013, 12:46 PM
  3. [CLOSED] Adding line series tooltip dynamically.
    By RCM in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: Apr 04, 2013, 7:06 PM
  4. [CLOSED] [#8] Chart: Hide Line Series values
    By cwolcott in forum 2.x Legacy Premium Help
    Replies: 12
    Last Post: Mar 14, 2013, 5:41 AM
  5. [CLOSED] Text on Series and Tool tips for Grouped Bar Chart
    By WHISHWORKS in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: Jul 16, 2012, 10:59 AM

Posting Permissions