@wavemaker/app-ng-runtime 11.5.1-rc.5418 → 11.5.1-rc.5420

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.
@@ -429,7 +429,10 @@ const highlightPoints = (id, highlightpoints) => {
429
429
  const setLineThickness = (id, thickness) => {
430
430
  const chartSvg = id ? d3.select('#wmChart' + id + ' svg') : d3.select(chartId + ' svg');
431
431
  thickness = thickness || 1.5;
432
- chartSvg.selectAll('.nv-line').style({ 'stroke-width': thickness });
432
+ const lines = chartSvg.selectAll('.nv-line');
433
+ if (lines.size() != 0) {
434
+ lines.style({ 'stroke-width': thickness });
435
+ }
433
436
  };
434
437
  // Constructing a common key value map for preview and canvas mode
435
438
  const initProperties = (widgetContext, propertyValueMap) => {
@@ -455,14 +458,18 @@ const getDateFormatedData = (dateFormat, d) => {
455
458
  * This is because it returns UTC time i.e. Coordinated Universal Time (UTC).
456
459
  * To create date in local time use moment
457
460
  */
458
- return d3.time.format(dateFormat)(new Date(moment(moment(d).format()).valueOf()));
461
+ return d3.timeFormat(dateFormat)(new Date(moment(moment(d).format()).valueOf()));
459
462
  };
460
463
  // Formats the given value according to number format
461
464
  const getNumberFormatedData = (numberFormat, d) => {
462
465
  let formattedData, divider, prefix;
463
466
  // formatting the data based on number format selected
464
467
  if (numberFormat) {
465
- formattedData = d3.format(numberFormat)(d);
468
+ let numberFormatter = d3.format(numberFormat);
469
+ if (numberFormat == 'Thousand' || numberFormat == 'Million' || numberFormat == 'Billion') {
470
+ numberFormatter = d3.format(',.2s');
471
+ }
472
+ formattedData = numberFormatter(d);
466
473
  // Getting the respective divider[1000,1000000,1000000000] based on the number format choosen
467
474
  divider = (tickformats[numberFormat] && tickformats[numberFormat].divider) || 0;
468
475
  prefix = tickformats[numberFormat] && tickformats[numberFormat].prefix;
@@ -745,10 +752,10 @@ const initChart = (widgetContext, xDomainValues, yDomainValues, propertyValueMap
745
752
  const postPlotChartProcess = (widgetContext, isPreview) => {
746
753
  const id = isPreview ? null : widgetContext.$id;
747
754
  // If user sets to highlight the data points and increase the thickness of the line
748
- // if (isLineTypeChart(widgetContext.type)) {
749
- // // setLineThickness(id, widgetContext.linethickness);
750
- // // highlightPoints(id, widgetContext.highlightpoints);
751
- // }
755
+ if (isLineTypeChart(widgetContext.type)) {
756
+ setLineThickness(id, widgetContext.linethickness);
757
+ highlightPoints(id, widgetContext.highlightpoints);
758
+ }
752
759
  // Modifying the legend position only when legend is shown
753
760
  // if (widgetContext.showlegend) {
754
761
  // modifyLegendPosition(widgetContext, widgetContext.showlegend, id);