<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
Derek,<br>
<br>
from your code snippet you've defined "chargechart", but try to
access "chargeChart" later on.<br>
<br>
Also $(…).chart() does not return a Highcharts object, but the
jQuery DOM object collection passed to it (for chaining).<br>
<br>
The correct way to get a reference to the actual Highcharts object
is using/remembering "this" in the load event, that is pointing to
the Highcharts instance.<br>
<br>
Regards,<br>
Michael<br>
<br>
<br>
Am 06.09.20 um 12:27 schrieb Derek Caudwell:<br>
<blockquote type="cite"
cite="mid:CAKUcfWFX5QNbF7Le+vj0+dH=J8UVjnc+WWMa78HrvO+0ck0q7w@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">Hi all,
<div><br>
</div>
<div>Appreciate some help on the best way to initialise
Highcharts when developing a web plugin - I am wanting to
extend the bms/cellmon to include shunt state and an extra
chart showing charge rate, SOC, battery temp etc. I started by
copying the js code from bms/cellmon page however I could not
replicate the initialisation which calls a separate javascript
if Highcharts is not loaded before initialisation. </div>
<div><br>
</div>
<div>I also tried a cut down version of the Trip Power Chart
(without history) initialising in the main script code with:</div>
<div>chargechart = $('#chargechart').chart({<br>
</div>
<div> chart: {<br>
type: 'line',<br>
events: {<br>
load: function () {$('#chgreceiver').on("msg:metrics",
function(e, update){<br>
if (update["v.b.soc"] != null) {<br>
updateChart();<br>
}<br>
});<br>
} etc<br>
</div>
<div><br>
</div>
<div>however in updateChart() I cannot reference chargeChart to
addPoints?</div>
<div><br>
</div>
<div>Cheers</div>
<div>Derek</div>
<div><br>
</div>
<div><br>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
OvmsDev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:OvmsDev@lists.openvehicles.com">OvmsDev@lists.openvehicles.com</a>
<a class="moz-txt-link-freetext" href="http://lists.openvehicles.com/mailman/listinfo/ovmsdev">http://lists.openvehicles.com/mailman/listinfo/ovmsdev</a>
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal
Fon 02333 / 833 5735 * Handy 0176 / 206 989 26</pre>
</body>
</html>