chart.js

Chart.js tooltip hover customization for mixed chart

ε祈祈猫儿з 提交于 2020-01-02 07:04:53
问题 I was having some problem when trying to customize the hover tooltip for mixed chart using chart.js. I have a bar chart which show the total profit for certain product and a line chart to show the total quantity of that certain product. When I hover over the bar chart, I wanted the tooltip to show something like: Total profit: $ 1399.30 The price should be in two decimal format appended to the back of 'Total profit: $'. When I hover over the line chart, I wanted to show something like:

Show only nth tick LINE on x-axis for Chart.js diagram

那年仲夏 提交于 2020-01-02 05:27:09
问题 I've been searching for a solution to this for a while but am getting no nearer to a solution due to the mass of deleted documentation and hacky answers for previous versions of the library. I'm working on a chart with ChartJS v2 with quarterly-month names along the x-axis, and I've set my labels so that only every 4th label is shown (i.e. one per year). The result is this: However, I would like to have it such that the tick lines also only appear on every 4th x-axis entry at the same point

dump missing date in data for chartjs

人走茶凉 提交于 2020-01-02 05:22:07
问题 Supposing that I will use line chart from ChartJS, and I have 'value by date' data. example: 5 : 05-11-2014 10 : 04-11-2014 55 : 01-11-2014 the chart will be contain 3 points. is there any solution, configuration that let me add automatically add (dump) missing date with value = 0, so the data for the example will be : 5 : 05-11-2014 10 : 04-11-2014 0 : 03-11-2014 0 : 02-11-2014 55 : 01-11-2014 and of course the chart will contain 5 points. I just need some logic to handle this kind of

ChartJS responsive resize for print - not working in Firefox/IE11/Edge

流过昼夜 提交于 2020-01-02 03:51:33
问题 Using the following code I've managed to get ChartJS to resize correctly on Chrome before the print page appears; function beforePrint () { for (const id in Chart.instances) { Chart.instances[id].resize() } } if (window.matchMedia) { let mediaQueryList = window.matchMedia('print') mediaQueryList.addListener((mql) => { if (mql.matches) { beforePrint() } }) } window.onbeforeprint = beforePrint Unfortunately this code does not work for Firefox/IE11/Edge. The beforePrint() function is being

vue.js vue-chartjs chart not updating when chartData replaced, updated etc

我的梦境 提交于 2020-01-01 15:55:54
问题 I am attempting to make a vue with vue-chartjs. I have followed all the associated documentation with regards to re-rendering the chart when the chartData prop is updated. My chart will only update after i resize the browser window. my parenttestchart.vue file: <template> <div> <h1>Chart datacollection update test</h1> <p>This component demonstrates fetching data from the server.</p> <p v-if="!datacollection"><em>Loading...</em></p> <b-form-select v-model="testthingSelect.selected" text=

Chart.js change legend toggle behaviour

大城市里の小女人 提交于 2020-01-01 12:49:09
问题 I have a radar chart from chart.js. Currently it loads in all the data which works great and the supporting legend behaves by clicking on the legend label which toggles off the data associated to the legend able. I want to be able to click on the legend label, it then toggles all the other off and maybe introduce an 'all' option? Is this doable with chart.js? Here is how my chart looks now: var chartata = { labels: [ "Strategic Development and Ownership", "Driving change through others",

Chart.js PolarArea Chart. Changing the labels to a 45 degree angle

笑着哭i 提交于 2020-01-01 11:33:08
问题 I have searched through the net with no success on how to solve this. I have seen people use a background image but that seems lazy and unhelpful. I want to move the labels to a 45 degree angle so it looks more professional. My chart currently looks like this - But I am wanting it to look like this - Anyone have any ideas on how I can do this? Copy of my code is underneath. new Chart(DummyChart, { type: "polarArea", data: { labels: ["Dummy1", "Dummy 2", "Dummy 3", "Dummy 4"], datasets: [ {

ChartJS won't draw graph inside bootstrap tab until window resize

余生长醉 提交于 2020-01-01 10:08:49
问题 I'm using bootstrap's tabs with chartjs charts inside every tab. One problem that have occurred though is that the graph canvas wont be drawn until i resize the browser window. And this is happening in both latest Chrome and Firefox. I've been trying different solutions as drawing the graph after the tab is changed but with no results. Unfortunately I was unable to duplicate the problem in jsfiddle, somehow it seems to work there. But there's pretty much all the code, besides the html5

ChartJS won't draw graph inside bootstrap tab until window resize

狂风中的少年 提交于 2020-01-01 10:07:40
问题 I'm using bootstrap's tabs with chartjs charts inside every tab. One problem that have occurred though is that the graph canvas wont be drawn until i resize the browser window. And this is happening in both latest Chrome and Firefox. I've been trying different solutions as drawing the graph after the tab is changed but with no results. Unfortunately I was unable to duplicate the problem in jsfiddle, somehow it seems to work there. But there's pretty much all the code, besides the html5

ChartJS won't draw graph inside bootstrap tab until window resize

巧了我就是萌 提交于 2020-01-01 10:07:05
问题 I'm using bootstrap's tabs with chartjs charts inside every tab. One problem that have occurred though is that the graph canvas wont be drawn until i resize the browser window. And this is happening in both latest Chrome and Firefox. I've been trying different solutions as drawing the graph after the tab is changed but with no results. Unfortunately I was unable to duplicate the problem in jsfiddle, somehow it seems to work there. But there's pretty much all the code, besides the html5