charts

Relative bar chart overlay on line chart in chart.js

吃可爱长大的小学妹 提交于 2021-02-10 19:41:00
问题 I'm trying to build a chart in chart.js, showing price data of a virtual item, with a line chart showing pricing, and a backlay bar chart, showing sales volume, like this: My issue is, the y-axis is the same for both, meaning the price data is shown at the bottom with unnoticeable differences, since the volume is in the hundreds. I want the price data to be on the y-axis, with the bars shown relatively, with the highest volume being shown as 100% height, not the values on the y-axis,

vAxis Single line label in angular-google-chart

天涯浪子 提交于 2021-02-10 15:46:30
问题 I am using angular-google-chart to implement google chart in my angular app, when the y axis labels (marked with red color) is too long it in coming up in three lines then showing "..." , i want only one one line to show up instead of 3, how this can be achieved. Any help is most appreciated. 回答1: in the chart's configuration options, you can add more room for the labels using the chartArea option... var options = { chartArea: { left: 600 } }; you can also reduce the font size using the

How to make chart horizontally scrollable

僤鯓⒐⒋嵵緔 提交于 2021-02-10 14:53:31
问题 I am using this chart library https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.3.0/Chart.min.js" and I have success to show the chart data, but I cannot make it scrollable horizontally. How to make it scroll? I've tried all the way <div class="wrapper" style="background-color: whitesmoke; "> <div class="chartAreaWrapper" style="width: 550px; overflow:scroll;"> <canvas id="myChart" width="1600" height="900"></canvas> </div> </div> this one of them, and this the javascript var years = [1,2,3,4

Add legend to line & bars to Altair chart without using size/color

自作多情 提交于 2021-02-10 14:51:44
问题 I'm using Altair to create a chart with multiple lines each of which has multiple bands (representing different CI) & I'm struggling to understand how I can add a legend. For example, in this considerably simpler example: import altair as alt import pandas as pd df = pd.DataFrame(data={'col1': [1, 2,4,5,6], 'col2': [3, 4,7,4,4], 'col3': [1.5, 2.6,4.6,5.6,6.6], 'col4': [3.6, 4.6,7.6,4.6,4.4],'col5': [1.9, 2.9,4.9,5.9,6.9], 'col4': [3.9, 4.9,7.9,4.9,4.9]}) line = alt.Chart(df).mark_line(color=

Sorting of Bars-ggplot2 in shiny

你说的曾经没有我的故事 提交于 2021-02-10 14:44:37
问题 Please find the code below for a shiny App using ggplot2, I do not know how to sort them inside the server.R code. WIth the below code I am able to display the bar chart and change it but ordering the data seems to be an issue. ui.R library(shiny) library(ggplot2) shinyUI(fluidPage( column(12,offset=5, titlePanel("Template Type by Hours")), br(), h6(textOutput("text1")), fluidRow( column(4,offset=0, wellPanel( selectInput("var","Hours", choices = colnames(sum1[2:8]),selected ="hrs_0to1")))),

Hide labels in plotly donut chart r

◇◆丶佛笑我妖孽 提交于 2021-02-10 14:14:50
问题 I am working on a Shiny app where I am plotting a Donut chart. The slices depend on the variable selected and sometimes are too small. In such cases the labels are displayed outside the chart like in the image below. Is there a way to altogether hide all the labels (values with % sign) in the chart and only allow the hover action to show the details? An reproducible code for a Donut Chart is as below: library(plotly) library(tidyr) library(dplyr) # Get Manufacturer mtcars$manuf <- sapply

Hide labels in plotly donut chart r

时光总嘲笑我的痴心妄想 提交于 2021-02-10 14:10:20
问题 I am working on a Shiny app where I am plotting a Donut chart. The slices depend on the variable selected and sometimes are too small. In such cases the labels are displayed outside the chart like in the image below. Is there a way to altogether hide all the labels (values with % sign) in the chart and only allow the hover action to show the details? An reproducible code for a Donut Chart is as below: library(plotly) library(tidyr) library(dplyr) # Get Manufacturer mtcars$manuf <- sapply

Creating pie chart in python

隐身守侯 提交于 2021-02-10 12:13:25
问题 I have created my pie chart but right now I am using a range of cells like this: chart3.add_series({ 'name': 'Pie data', 'categories': '=Pivots!$A$3:$A$10', 'values': '=Pivots!$F$3:$F$10'}) which gives me a pie chart with the categories that are found in A3-A10 and values that correspond from cells F3-F10. The problem I am having is unfortunately I am not always going to have data in each of these cells. so I may have data in one worksheet that has categories and values that may range from A3

Keep chart/graph style

南楼画角 提交于 2021-02-10 11:27:26
问题 Is it possible to keep the chart style (shape styles) from a xlsx file when I read and write it? With my code below the style is lost . require 'vendor/autoload.php'; use PhpOffice\PhpSpreadsheet\Spreadsheet; use PhpOffice\PhpSpreadsheet\Writer\Xlsx AS WXlsx; use PhpOffice\PhpSpreadsheet\Chart\Chart; use PhpOffice\PhpSpreadsheet\Settings; use PhpOffice\PhpSpreadsheet\Reader\Xlsx; echo "Opening file...<br>"; $spreadsheet = new Xlsx(); $spreadsheet->setIncludeCharts(true); $spreadsheet =

Keep chart/graph style

不想你离开。 提交于 2021-02-10 11:27:14
问题 Is it possible to keep the chart style (shape styles) from a xlsx file when I read and write it? With my code below the style is lost . require 'vendor/autoload.php'; use PhpOffice\PhpSpreadsheet\Spreadsheet; use PhpOffice\PhpSpreadsheet\Writer\Xlsx AS WXlsx; use PhpOffice\PhpSpreadsheet\Chart\Chart; use PhpOffice\PhpSpreadsheet\Settings; use PhpOffice\PhpSpreadsheet\Reader\Xlsx; echo "Opening file...<br>"; $spreadsheet = new Xlsx(); $spreadsheet->setIncludeCharts(true); $spreadsheet =