chartist.js

How to make chartist update on Vuejs

让人想犯罪 __ 提交于 2021-01-29 10:10:57
问题 First of all a happy new year to everyone. I would like to call update at chartist-js . main.js import Chartist from "chartist"; Vue.prototype.$Chartist = Chartist; Component.vue <chart-card :chart-data="performanceUser.data" :chart-options="performanceUser.options" chart-type="Line" data-background-color="green"> </chart-card> Component.vue -> methods getStatsUser(){ UsersAPI.getUserPerformance(this.users.filters.user.active).then(r => { this.performanceUser.data.labels = r.data.labels; this

TypeError: Chartist.plugins.legend is not a function

こ雲淡風輕ζ 提交于 2021-01-28 21:30:30
问题 I'm have recently started use Meteor build tool with Chartist to represent my data. I have java script for legend template (source from internet) Template.js function drawBarChart() { new Chartist.Bar('.legendChart1', { labels: ['First quarter of the year', 'Second quarter of the year', 'Third quarter of the year', 'Fourth quarter of the year'], series: [ { "name": "Money A", "data": [60000, 40000, 80000, 70000] }, { "name": "Money B", "data": [40000, 30000, 70000, 65000] } ] }, { plugins: [

How to change line colors of chart in Chartist.js

穿精又带淫゛_ 提交于 2020-01-14 03:20:16
问题 I'm currently using Chartist.js , But I can't change the default line colors of Chart. Chartist.js For SIMPLE LINE CHART I've tried: .ct-series-a .ct-line{ background-color: blue; } But It brings no result. How to fix this? 回答1: Try this: .ct-series-a .ct-line { /* Set the colour of this series line */ stroke: red; /* Control the thikness of your lines */ stroke-width: 5px; /* Create a dashed line with a pattern */ stroke-dasharray: 10px 20px; } https://gionkunz.github.io/chartist-js/getting

Can't get Chartist legend plugin to work

房东的猫 提交于 2020-01-05 04:33:11
问题 I've got the mfpierre:chartist meteor package installed and the mspi:chartistlegend plugin for it installed (both atmosphere packages). I've got the plugin like so: new Chartist.Bar('.ct-chart', { labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], series: [ [1,2,3,4], [1,2,3,4], [1,2,3,4] ] }, { plugins: [ Chartist.plugins.legend() ] }); The chart won't render with the "plugins" key/value pair in place. If I remove the "plugins" key/value, the chart

Using Chartist.js how do you change the color of the stroke for a donut chart?

折月煮酒 提交于 2020-01-02 00:14:11
问题 Hello I am trying to create the following donut chart using Chartist.js: GOAL CHART This is what the chart looks like currently: Chartist.js Donut Chart I am trying to find where or how I can change the colors of this chart to match the 1st donut chart. The red and pink seem to be the defaults. I haven't been able to find any documentation of how to accomplish this goal. I would also like to customize the size of the stroke and the size of the chart itself. Any help is greatly appreciated!

Add outline to SVG data point in chartist.js

十年热恋 提交于 2019-12-31 21:33:06
问题 I'm playing around with Chartist.js and just wondering if you can give me a hand applying some styling to the SVG. Here is my code as follows: jQuery: new Chartist.Line('.ct-chart', { labels: [1, 2, 3, 4, 5, 6, 7, 8], series: [ [5, 9, 7, 8, 5, 3, 5, 4] ] }, { low: 0, showArea: true }); HTML: <div class="ct-chart ct-perfect-fourth"></div> CSS: .ct-chart .ct-series.ct-series-a .ct-area { fill: orange; } .ct-chart .ct-series.ct-series-a .ct-line { stroke: orange; } .ct-chart .ct-series.ct-series

How to import chartist in react component?

*爱你&永不变心* 提交于 2019-12-11 14:57:05
问题 I am trying to use charts from chartist.js link: https://gionkunz.github.io/chartist-js/examples.html#simple-line-chart When I try to use them in my code I am getting Chartist to defined how can I import it in my component ? Code: import React, { Component } from 'react'; import chartistGraph from "react-chartist"; const simpleLineChartData = { labels: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'], series: [ [12, 9, 7, 8, 5], [2, 1, 3.5, 7, 3], [1, 3, 4, 5, 6] ] } class Chart

Chartist label as image

为君一笑 提交于 2019-12-11 06:07:45
问题 I'm using chartist to create donut chart. I want to replace label to image. Try to find something simple as just replace string to image any idea? 来源: https://stackoverflow.com/questions/41337839/chartist-label-as-image

Display text inside bar in bar chart with Chartist.js

懵懂的女人 提交于 2019-12-11 04:56:17
问题 So, I'm trying to display some text inside the actual bars of a bar chart using Chartist.js charts. The end result should look something like this: Which property do I need to set in order to get the text inside the bars? 回答1: I would use chartist-bar-labels it should provide what you are looking for, with it you can add the following code: Chartist.plugins.ctBarLabels({ position: { x: function (data) { return data.x1 + 50 } }, labelOffset: { y: 7 }, labelInterpolationFnc: function (text) { /

Chartist.js and events

纵饮孤独 提交于 2019-12-10 18:27:55
问题 I am trying to add click events on the graphs that I am rendering. From chart.click to chart.on('click', function (e){ }). What I am trying to do is allow the user to select points on the graph and for me to now what selections the user made. Is that at all possible using chartist.js? I read through the documentation: CHARTIST.JS My code: if (item.GraphType.Description == "Line") { var chart = new Chartist.Line( container[0], { labels: d.Labels, series: d.SeriesData }, { axisY: { offset: 60 }