@millistream/millistream-widgets 0.0.17 → 0.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/millistream-widgets.js +1 -9
- package/package.json +1 -1
package/millistream-widgets.js
CHANGED
|
@@ -493,12 +493,9 @@ function Milli_Chart(settings) {
|
|
|
493
493
|
m_ctx.lineWidth = parseInt(m_instrumentCss[0].width);
|
|
494
494
|
m_ctx.beginPath();
|
|
495
495
|
var width = Math.round(m_chartspaces.lowerChart.width / (m_datapoints.length + 1) / 2);
|
|
496
|
-
console.log(m_chartspaces.lowerChart.width, m_datapoints.length);
|
|
497
496
|
if (width < 2) width = 2;
|
|
498
497
|
else if (width > 20) width = 20;
|
|
499
|
-
if (width * (m_datapoints.length + 1) >= m_chartspaces.lowerChart.width) console.log('test');
|
|
500
498
|
m_ctx.lineWidth = width;
|
|
501
|
-
console.log(width);
|
|
502
499
|
for (var i = 0; i < m_datapoints.length; i++) {
|
|
503
500
|
var x = Math.round(m_datapoints[i].x);
|
|
504
501
|
if (x - width < m_chartspaces.lowerChart.left) {
|
|
@@ -525,7 +522,6 @@ function Milli_Chart(settings) {
|
|
|
525
522
|
|
|
526
523
|
m_ctx.textAlign = 'right';
|
|
527
524
|
var tickSize = getTickValue(_this.scaleinfoY.lowLowerChart, _this.scaleinfoY.highLowerChart, numticks);
|
|
528
|
-
console.log(_this.scaleinfoY.highLowerChart, tickSize, lineLength);
|
|
529
525
|
var maxValue = _this.scaleinfoY.highLowerChart == 0 ? 100 : _this.scaleinfoY.highLowerChart + (tickSize * 0.2);
|
|
530
526
|
var valuePerPixel = lineLength / maxValue;
|
|
531
527
|
if (isNaN(valuePerPixel) || !isFinite(valuePerPixel)) {
|
|
@@ -535,7 +531,6 @@ function Milli_Chart(settings) {
|
|
|
535
531
|
var value = 0;
|
|
536
532
|
for (;;) {
|
|
537
533
|
var y = Math.round(m_chartspaces.lowerChart.bottom - (value * valuePerPixel));
|
|
538
|
-
console.log(value, y, tickSize, maxValue);
|
|
539
534
|
|
|
540
535
|
if (y <= m_chartspaces.lowerChart.top) break;
|
|
541
536
|
if (y <= m_chartspaces.lowerChart.bottom) {
|
|
@@ -575,7 +570,6 @@ function Milli_Chart(settings) {
|
|
|
575
570
|
//m_ctx.save();
|
|
576
571
|
m_ctx.strokeStyle = m_gridHorizontalCss.color;
|
|
577
572
|
m_ctx.font = m_yLegendCss['font-weight'] + ' ' + m_yLegendCss['font-size'] + ' ' + m_yLegendCss['font-family'];
|
|
578
|
-
console.log(m_yLegendCss.color, m_gridHorizontalCss.color);
|
|
579
573
|
m_ctx.fillStyle = m_yLegendCss.color;
|
|
580
574
|
var lineLen = m_chartspaces.lowerChart.bottom - m_chartspaces.lowerChart.top;
|
|
581
575
|
var numticks = lineLen / (getFontSize(m_yLegendCss) * 2);
|
|
@@ -593,11 +587,9 @@ function Milli_Chart(settings) {
|
|
|
593
587
|
|
|
594
588
|
function drawYLegend(si, x, side, gridHorizontalLines, number) {
|
|
595
589
|
var value;
|
|
596
|
-
if (si.highValue == si.lowValue) console.log(si.tickSize);
|
|
597
590
|
si.maxValue = si.highValue + (si.tickSize * 0.2);
|
|
598
591
|
si.minValue = si.lowValue - (si.tickSize * 0.2);
|
|
599
592
|
m_ctx.font = m_yLegendCss['font-weight'] + ' ' + m_yLegendCss['font-size'] + ' ' + m_yLegendCss['font-family'];
|
|
600
|
-
// console.log('drawYLegend in 2,', si.highValue, si.lowValue, si.tickSize);
|
|
601
593
|
if (si.highValue == si.lowValue) { // only have one value so set values for 1 line only
|
|
602
594
|
si.maxValue = si.maxValue + si.tickSize;
|
|
603
595
|
si.minValue = si.minValue - si.tickSize;
|
|
@@ -2672,7 +2664,7 @@ function Milli_Chart(settings) {
|
|
|
2672
2664
|
_this.settings.startdate = startdate.getFullYear() + '-' + zeroPad(startdate.getMonth() + 1, 2) + '-' + zeroPad(startdate.getDate(), 2);
|
|
2673
2665
|
url = MillistreamWidgetApi_buildQuery(_this, 'historychart');
|
|
2674
2666
|
_this.settings.fields = oldfields;
|
|
2675
|
-
console.log(_this.settings.fields);
|
|
2667
|
+
//console.log(_this.settings.fields);
|
|
2676
2668
|
millistream_data_api.fetch(url, function(data) {
|
|
2677
2669
|
_this.buildwidget(data);
|
|
2678
2670
|
|