Skip to content

Commit

Permalink
Build and bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
Makanz committed Jul 11, 2024
1 parent ce27450 commit 9eca5b0
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion dist/chartjs-plugin-trendline.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/chartjs-plugin-trendline.min.js.LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* chartjs-plugin-trendline.js
* Version: 2.1.0
* Version: 2.1.2
*
* Copyright 2024 Marcus Alsterfjord
* Released under the MIT license
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "chartjs-plugin-trendline",
"version": "2.1.1",
"version": "2.1.2",
"description": "Trendline for Chart.js",
"main": "src/chartjs-plugin-trendline.js",
"scripts": {
Expand Down
13 changes: 9 additions & 4 deletions src/chartjs-plugin-trendline.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* chartjs-plugin-trendline.js
* Version: 2.1.0
* Version: 2.1.2
*
* Copyright 2024 Marcus Alsterfjord
* Released under the MIT license
Expand Down Expand Up @@ -54,9 +54,14 @@ const addFitter = (datasetMeta, ctx, dataset, xScale, yScale) => {
let fillColor = dataset.trendlineLinear.fillColor;

const chartOptions = datasetMeta.controller.chart.options;
const parsingOptions = typeof chartOptions.parsing === 'object' ? chartOptions.parsing : undefined;
const xAxisKey = dataset.trendlineLinear.xAxisKey || parsingOptions?.xAxisKey || 'x';
const yAxisKey = dataset.trendlineLinear.yAxisKey || parsingOptions?.yAxisKey || 'y';
const parsingOptions =
typeof chartOptions.parsing === 'object'
? chartOptions.parsing
: undefined;
const xAxisKey =
dataset.trendlineLinear.xAxisKey || parsingOptions?.xAxisKey || 'x';
const yAxisKey =
dataset.trendlineLinear.yAxisKey || parsingOptions?.yAxisKey || 'y';

let fitter = new LineFitter();
let firstIndex = dataset.data.findIndex((d) => {
Expand Down

0 comments on commit 9eca5b0

Please sign in to comment.