charts

Google Charts stops drawing after first chart

寵の児 提交于 2019-12-18 05:02:25
问题 What I want to do Show multiple Barcharts on one Page What I already did The Barcharts have prevously been Linecharts. As Linecharts I could show two Charts on the same page without a problem. I used two seperate drawChart()-functions for them. I then converted the charts to Barcharts (material design). Now it only shows one chart. I already searched for an answer and found this: How to add two Google charts on the one page? I follow this and it still doesn't work. My Code <script type="text

Embedding WinForms Graph in WPF Window

蹲街弑〆低调 提交于 2019-12-18 04:48:22
问题 I've tried to embed a .NET WinForms graph (Stephan Zimmermann's Graph Display) in a WPF window, under a WindowsFormsHost (I've referenced both System.Windows.Forms and WindowsFormsIntegration). However, I can see the form panel but not the graph. I've ran the demo application on a windows form and it worked, but when I transfered the same code to the WPF window, I saw that the data is updated but not shown on the graph. Thank everyone in advance, Yaron. 回答1: Could you try the following code

ChartJS: datalabels: show percentage value in Pie piece

冷暖自知 提交于 2019-12-18 04:47:14
问题 I have a piechart with four labels: var data = [{ data: [50, 55, 60, 33], labels: ["India", "China", "US", "Canada"], backgroundColor: [ "#4b77a9", "#5f255f", "#d21243", "#B27200" ], borderColor: "#fff" }]; Using chartjs-plugin-datalabels plugin I wanted to show percentage value in each Pie piece with below code: formatter: (value, ctx) => { let datasets = ctx.chart.data.datasets; if (datasets.indexOf(ctx.dataset) === datasets.length - 1) { let sum = 0; datasets.map(dataset => { sum +=

How to draw Chart based on DataTable from console application?

坚强是说给别人听的谎言 提交于 2019-12-18 04:40:27
问题 How to use System.Windows.Forms.DataVisualization.Charting.Chart inside console application to draw an graph and save it to file? 回答1: //populate dataset with some demo data.. DataSet dataSet = new DataSet(); DataTable dt = new DataTable(); dt.Columns.Add("Name", typeof(string)); dt.Columns.Add("Counter", typeof(int)); DataRow r1 = dt.NewRow(); r1[0] = "Demo"; r1[1] = 8; dt.Rows.Add(r1); DataRow r2 = dt.NewRow(); r2[0] = "Second"; r2[1] = 15; dt.Rows.Add(r2); dataSet.Tables.Add(dt); //prepare

Plotting 2D heat map

試著忘記壹切 提交于 2019-12-18 04:23:15
问题 I have a chart on which I want to plot a heat map; the only data I have is humidity and temperature, which represent a point in the chart. How do I get the rectangular type of heat map on the chart in c#? What I want is similar to picture below : What I really want is a rectangular region in the chart which is plotted in different color based on the point that i get from the list of points and form the colorful section in the chart. 回答1: You have a choice of at least three ways to create a

How set color family to pie chart in chart.js

好久不见. 提交于 2019-12-18 04:12:25
问题 I am trying to draw a pie chart using Chart.js. My values are coming from a database hence I don't know how many values there are going to be in the database. Here I want to set set a unique color to each value. Below is my example. var pieData = [ { value: 20, color:"#878BB6" }, { value : 40, color : "#4ACAB4" }, { value : 10, color : "#FF8153" }, { value : 30, color : "#FFEA88" } ]; var pieOptions = { segmentShowStroke : false, animateScale : true } var countries= document.getElementById(

Programmatically open and close Chart.js tooltip

半城伤御伤魂 提交于 2019-12-18 03:41:28
问题 Chart.js 2.2.1 Any idea how to trigger the code that runs when I hover over a datapoint, and that runs when I move the mouse off? I need to programmatically show and hide a chart's tooltip. openTip(oChart, datasetIndex, pointIndex){ // how to open a specific tooltip? } closeTip(oChart, datasetIndex, pointIndex){ // how to close the same tooltip? } I would show sample code if I could, but I don't even know where to start. The chart method docs haven't helped. JSFiddle 回答1: The code below will

Programmatically open and close Chart.js tooltip

柔情痞子 提交于 2019-12-18 03:41:10
问题 Chart.js 2.2.1 Any idea how to trigger the code that runs when I hover over a datapoint, and that runs when I move the mouse off? I need to programmatically show and hide a chart's tooltip. openTip(oChart, datasetIndex, pointIndex){ // how to open a specific tooltip? } closeTip(oChart, datasetIndex, pointIndex){ // how to close the same tooltip? } I would show sample code if I could, but I don't even know where to start. The chart method docs haven't helped. JSFiddle 回答1: The code below will

Using plotly without online plotly account

断了今生、忘了曾经 提交于 2019-12-17 23:36:31
问题 Is it possible to use the plotly library to create charts in python without having an online plotly account? I think the code is opensource https://github.com/plotly/plotly.py. I would like to know whether we can use this without an online account. 回答1: Yes, it can be done. The only purpose of having a plotly account is to host the graphs in your plotly account. Plotly Offline allows you to create graphs offline and save them locally. Instead of saving the graphs to a server, your data and

Charts.js graph not scaling to canvas size

爷,独闯天下 提交于 2019-12-17 23:31:59
问题 I'm trying to make a graph with Charts.js (current one is just a really simple example I'm trying to get working, somewhat taken from the Chart.js documentation) and the graph isn't scaling to the size of the canvas I'm giving it. Here is all the relevant code. To import it: <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.1.6/Chart.bundle.min.js"></script> Then, I connect it to a javascript file as follows: <script type="text/javascript" src="js/stats_tab.js"></script> I have