I think I figured out your problem...
The problem lies in the arrays you are passing, do not have the same number of parameters.
On the second graph you have this:
var xVals2 = [[1, 2, 3, 4, 5, 6, 7],[3.5, 4.5, 5.5, 6.5, 7, 8]]; //data coube x1, courbe x2
var yVals2 = [[2, 10, 15, 5], [5, 9, 13, 15, 10 ]]; //data
in x you have two elements, the first with 7 positions and the second with 6 positions, in y you have two elements where the first has 4 positions and the second has 5 positions...
Trying to simplify more... in x the first element, must have the same number of positions as the first element in y.
I send you the arrays of the second graph:
var xVals2 = [[1, 2, 3, 4],[3.5, 4.5, 5.5, 6.5, 7]]; //data coube x1, courbe x2
var yVals2 = [[2, 10, 15, 5], [5, 9, 13, 15, 10 ]]; //data
how can I adapt to my code @Renan?
– akm
@Renan, you should only be cautious and warn the user about the differences between the library licenses you use and the one you suggested, because the Raphael.js uses MIT license, already the library you suggested uses Creative Commons for versions Non-commercial (Non-commercial), being paid for commercial versions.
– Fernando Leal
@Fernando thanks for the warning.
– Renan Gomes