the highchart data is converted to an svg path, so you'd have to interpret the path yourself. i'm not sure why you would want to do this, actually: in general you can trust 3rd party libraries to work as advertised; the testing of that code should reside in that library.

if you still want to do it, then you'd have to dive into javascript to retrieve the data. taking the highcharts demo as an example, you can extract the data points for the first line as shown below. this will give you the svg path definition as a string, which you can then parse to determine the origin and the data points. comparing this to the size of the vertical axis should allow you to calculate the value implied by the graph.

# get the origin and datapoints of the first line
s = selenium.get_eval("window.jquery('svg g.highcharts-tracker path:eq(0)')")
splitted = re.split('\s+l\s+', s)
origin = splitted[0].split(' ')[1:]
data = [p.split(' ') for p in splitted[1:]]
# convert to floats
origin = [float(origin[1]), float(origin[2])]
data = [[float(x), float(y)] for x, y in data]

# get the min and max y-axis value and position
min_y_val = float(selenium.get_eval( \
             "window.jquery('svg g.highcharts-axis:eq(1) text:first').text()")
max_y_val = float(selenium.get_eval( \
             "window.jquery('svg g.highcharts-axis:eq(1) text:last').text()")
min_y_pos = float(selenium.get_eval( \
             "window.jquery('svg g.highcharts-axis:eq(1) text:first').attr('y')")
max_y_pos = float(selenium.get_eval( \
             "window.jquery('svg g.highcharts-axis:eq(1) text:last').attr('y')")

# calculate the value based on the retrieved positions
y_scale = min_y_pos - max_y_pos
y_range = max_y_val - min_y_val
y_percentage = data[0][1] * 100.0 / y_scale
value = max_y_val - (y_range * percentage)

disclaimer: i didn't have to time to fully verify it, but something along these lines should give you what you want.

Related Query

More Query from same tag