Can you tell me what this error message means?


« Back to message list

Enter your email address to get email updates on this topic. You can stop receiving updates by clicking the link in the update email messages.

Posted by Todd Shafer on 19th December 2017
I hate to bug you with this, but I've tried my best to figure out what's going on and can't. I get this error: Error: <path> RGraph.svg.common.core.js:186 attribute d: Expected number, "03703707 L462.5 null L470 null L". Can you tell me what this error means so I can fix it?
Posted by Richard on 19th December 2017
Hi there,

Can you put the page that generates the error online so that I can see it? I can't tell what it is from that.

Richard
Posted by Todd Shafer on 19th December 2017
Go to www.dynamicproduction.com/2018/
Click Quest
Click the blue Charts button (near top right area of page)
Click 3. Success Rate (Cumulative)
Click the Quote button beneath chart.

You'll see the chart stops at 9/28. I'm sure it's a value issue because when I changed the values to 50 it ran fine. However, if you hover to see tooltips you see that there's are values from 9/28 on, which is what confuses me.
Posted by Richard on 19th December 2017
Hi there,

There is no !2. Success rate". In fact there's no Line on the chart at all. But I do get this in the console:

Uncaught TypeError: e.target.className.split is not a function

Richard
Posted by Todd Shafer on 21st December 2017
When I use this code chartQuery sets the type variable, which is set when I click a button. However, the chart line stops mid way with the error message I sent earlier.

   $.ajax({
    type: 'GET',
    dataType : 'json',
    url: "includes/charts/success_rate_cum.php",
    data: ({
     start_date : start_date,
     type : chartQuery,
     staff_id : staff_id,
     fc_code : fc_code
    }),

When I use this code it works (all I did was set the type variable manually):

   $.ajax({
    type: 'GET',
    dataType : 'json',
    url: "includes/charts/success_rate_cum.php",
    data: ({
     start_date : start_date,
     type : 'quote',
     staff_id : staff_id,
     fc_code : fc_code
    }),

  I added an alert so I could double check if the chartQuery variable was setting correctly and it is. So I'm completely baffled. Below is a video link showing what happens.

www.youtube.com/watch?v=CGBkbS8KiD8&;feature=youtu.be
Posted by Richard on 21st December 2017
Hi there,

If that's the only thing that you're changing then are you sure that it contains the string "query"?

Right before the AJAX request try doing this:

$p(chartQuery);

This will print the variables contents and it's type (string/number/object etc).

Richard
Posted by Richard on 21st December 2017
Hi there,

Or, as an alternative to the $p() function there's also a $cl() function which is a shorthand for console.log()

Richard
Posted by Todd Shafer on 21st December 2017
That is the only thing I'm changing. When doing $p(chartQuery); it says, "quote (string, 5)"
Posted by Richard on 22nd December 2017
Hi there,

What about if you remove the trace animation to a simple .draw() ? Does it draw the whole chart?

Richard
Posted by Todd Shafer on 22nd December 2017
No.
Posted by Richard on 22nd December 2017
Hi there,

You appear to have null values in the path for the red line - so your data probably has unexpected values in it too. Use the $cl() function to log it to the console in your AJAX success function so you can then examine it.

Convert any blank/undefined values to the word null. ie Convert this:

[4,8,6,,8,5]

to this:

[4,8,6,null,8,5]

Richard
Posted by Todd Shafer on 22nd December 2017
Before emailing you I tried inspecting the data to see there was an empty or null. It was when I made a page for you to see what was happening that I discovered that everything worked when I did type: 'quote', but didn't work when using type: chartQuery (and having the chartQuery variable set to 'quote'). Below is the returned value.

0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25,16.67,16.67,16.67,16.67,16.67,16.67,16.67,16.67,16.67,16.67,16.67,16.67,16.67,16.67,16.67,16.67,16.67,16.67,16.67,16.67,16.67,16.67,16.67,16.67,16.67,16.67,16.67,28.57,25,25,37.5,50,40,40,40,40,60,60,60,60,60,54.55,63.64,58.33,58.33,58.33,58.33,58.33,58.33,58.33,58.33,58.33,58.33,50,50,50,50,50,50,57.14,57.14,57.14,57.14,57.14,64.29,64.29,64.29,64.29,64.29,64.29,64.29,64.29,64.29,64.29,64.29,64.29,64.29,64.29,60,60,56.25,56.25,56.25,52.94,52.94,52.94,52.94,52.94,52.94,58.82,55.56,55.56,52.63,52.63,52.63,57.89,57.89,57.89,57.89

When I set the variable with the above data I still get the error on my actual site. Like in the video I sent. When I set it in my test.html, it works. I also ran the returned variable through a loop (see below)

     var test= [];
     for(i in ratio){
      test[i] = ((ratio[i] == '' || ratio[i] == null) && ratio[i] != 0) ? 5 : 1;
     }
    
     var data = [test, success_bar];


Nothing came back null or empty. I appreciate you trying to resolve this, but this may be an anomaly. I'm also thinking the chartQuery variable is somehow interfering, but I can't find any connection.
Posted by Richard on 22nd December 2017
Hi there,

Can you put the chart, with src code, on a page by itself. No AJAX involved. So that I can copy it to a file on my desktop, update the paths to just the libraries, and run it.

So that I can debug it locally.

Richard
Posted by Todd Shafer on 23rd December 2017
When I put it on another page it works. The function that gets the 'quote' value is:

         $(document).on('click', '.getChartType', function(e){

    chartQuery = $(this).attr("class").split(' ')[0].split('-')[0];
    $('.getChartType').removeClass('getChart-active');
    $(this).addClass('getChart-active');
    getChart();

         });


If I put chartQuery = 'quote'; in the code above before getChart() it doesn't work. I even removed everything else but the getChart() and it didn't work. However, if I put chartQuery = 'quote'; in the getChart() function it does work. The code above is the only thing that calls the getChart();

Below is the getChart() function. Again, everything works fine except when clicking the Quote button that gets set the chartQuery variable to 'quote',

function getChart(){
 
  // Clear the chart if need be
  // chartState is set with first as true. After charr is created it is set to false.
  if(chartState.bar != null) RGraph.SVG.clear(chartState.bar.svg);
  if(chartState.line != null) RGraph.SVG.clear(chartState.line.svg);
 
  $('#chart_left, #chart_buttons, #chart-table, #chart-container, #chart-line').hide();
  $('.getChartType, #chart-loading').show();
 
   $.ajax({
    type: 'GET',
    dataType : 'json',
    url: "includes/charts/success_rate_cum.php",
    data: ({
     start_date : start_date,
     type : chartQuery,
     staff_id : staff_id,
     fc_code : fc_code
    }),
    success : function(msg) {
    
     $('#chart-line').show();
     $('#chart-loading, .close-chart, .app-chart, .premium-chart').hide();
     $('#chart_left, #chart_buttons').fadeIn();
     $('.sold-chart').hide();
    
     var ratio = msg.ratio;
     var title_type = msg.type;
     var success_bar = msg.success_bar;
     var label = msg.label;
     var highest_value = msg.highest_value + 2;
     if(highest_value < 5) highest_value = 5;
     if(msg.highest_value == highest_value) highest_value = 6
       
     var data = [ratio, success_bar];
     var avg = 'Avg:' + success_bar[0];
     tips = msg.tooltips;
    
    
     //ratio.forEach(makeString);
     //$('#chart-menu').text(ratio.join());
     if(chartState.line === null){
 
      chartState.line = new RGraph.SVG.Line({
       id: 'chart-line',
       data: data,
       options: {
        hmargin: 0,
        gutterLeft: 50,
        gutterRight: 35,
        gutterBottom: 50,
        yaxisUnitsPost: '%',
        linewidth: 3,
        title: 'Success Rate (' + title_type + ')',
        titleSize: 24,
        backgroundGridVlinesCount: 7,
        textSize: 10,
        key: ['Rate', avg],
        gutterTop: 60,
        tooltips: tips,
        xaxisLabelsPosition : 'section',
        xaxisLabels: label,
        yaxisMax: highest_value
       }
      }).trace();
    
     } else {
     
      chartState.line.originalData = RGraph.arrayClone(data);
      chartState.line.properties.title = 'Success Rate (' + title_type + ')';
      chartState.line.trace();
     
     }
    
         
    },
    error: function(XMLHttpRequest, textStatus, errorThrown, msg) {
     alert('Error: Get chart failed.');
    }
  
 
   });


}
Posted by Richard on 23rd December 2017
Hi there,

Right above where you create the chart (ie the new RGraph.SVG.Line bit) try adding $cl(data) and examine the variable in your console, (to see the console press CTRL+SHIFT+J ).

Richard
Posted by Todd Shafer on 23rd December 2017
When copying the data to send to you I noticed that what I thought was the ask data, was actually the quote data and visa versa. I thought, "that's weird..." and it prompted me to set the initial chartQuery to 'quote' instead of 'ask'. When I did that, it all worked fine. However, if I set it to 'dial' or 'ask' it fails. Do you have any idea why that would happen?

Below are the ask and quote $cl info:

(2) [Array(118), Array(118)]0: (118) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 36.36, 36.36, 33.33, 33.33, 42.86, 42.86, 42.86, 42.86, 42.86, 42.86, 42.86, 42.86, 42.86, 42.86, 42.86, 42.86, 42.86, 42.86, 42.86, 42.86, 42.86, 42.86, 42.86, 42.86, 42.86, 42.86, 42.86, 42.86, 42.86, 42.86, 42.86, 46.67, 47.06, 47.06, 47.06, 47.06, 52.63, 52.63, 52.63, 52.63, 52.63, 52.63, 52.63, 52.63, 40, 32.35, 32.35, 34.29, 34.29, 34.29, 34.29, 34.29, 34.29, 34.29, 34.29, 34.29, 34.29, 37.84, 37.84, 37.84, 37.84, 37.84, 37.84, 37.84, 37.84, 37.84, 37.84, 37.84, 37.84, 37.84, 37.84, 37.84, 37.84, 37.84, 37.84, 37.84, 37.84, 37.84, 37.84, 37.84, 37.84, 36.84, 36.59, 36.59, 38.1,]1: (118) [35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81, 35.81,]length: 2__proto__: Array(0)
    
    
(2) [Array(118), Array(118)]0: (118) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 16.67, 16.67, 16.67, 16.67, 16.67, 16.67, 16.67, 16.67, 16.67, 16.67, 16.67, 16.67, 16.67, 16.67, 16.67, 16.67, 16.67, 16.67, 16.67, 16.67, 16.67, 16.67, 16.67, 16.67, 16.67, 16.67, 16.67, 28.57, 25, 25, 37.5, 50, 40, 40, 40, 40, 60, 60, 60, 60, 60, 54.55, 63.64, 58.33, 58.33, 58.33, 58.33, 58.33, 58.33, 58.33, 58.33, 58.33, 58.33, 50, 50, 50, 50, 50, 50, 57.14, 57.14, 57.14, 57.14, 57.14, 64.29, 64.29, 64.29, 64.29, 64.29, 64.29, 64.29, 64.29, 64.29, 64.29, 64.29, 64.29, 64.29, 64.29, 60, 60, 56.25,]1: (118) [37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75, 37.75,]length: 2__proto__: Array(0)
Posted by Todd Shafer on 23rd December 2017
The charts in this section of my web are Dial, Ask and Quote. In that order. If I set chartQuery to 'ask', the dial and ask both work, but quote doesn't. If I set chartQuery to 'dial', dial works but ask and quote don't work. If I set it to quote, they all work.
Posted by Richard on 23rd December 2017
Hi there,

Then I don't know what the issue is I'm afraid.

Richard
Posted by Todd Shafer on 24th December 2017
I understand. I figure out a workaround. I believe it has something to do with the code below:

chartState.line.originalData = RGraph.arrayClone(data);
chartState.line.properties.title = 'Success Rate (' + title_type + ')';
chartState.line.trace();

It's like the new data is interfering with the previous data...

If instead of using the code above I rebuild it with the code below. It works. However, the trace effect doesn't. Understanding what is happening I was able to put on a page for you to see. The link is at the bottom. Click the Dial button and it will work. Then click Ask or Quote and you will get the error. If you refresh the page and click Ask first, Dial and Ask will work, but Quote won't. If you click Quote first, they all work.

www.dynamicproduction.com/2018/test.html

  chartState.line = new RGraph.SVG.Line({
   id: 'chart-line',
   data: data,
   options: {
    hmargin: 0,
    gutterLeft: 50,
    gutterRight: 35,
    gutterBottom: 50,
    yaxisUnitsPost: '%',
    linewidth: 3,
    title: 'Success Rate (' + title_type + ')',
    titleSize: 24,
    backgroundGridVlinesCount: 7,
    textSize: 10,
    key: ['Rate', avg],
    gutterTop: 60,
    tooltips: tips,
    xaxisLabelsPosition : 'section',
    xaxisLabels: label,
    yaxisMax: highest_value
   }
  }).trace();

Does this prompt any thought as to what it might be?
Posted by Richard on 26th December 2017
Hi there,

Nope. Try making the chart as basic as possible like this:

chartState.line = new RGraph.SVG.Line({
    id: 'chart-line',
    data: data,
    options: {
    }
}).draw()



Richard

Add a reply




« Back to message list