How to make a stacked bars chart using a single dataset with TDBChart VCL Teechart component? - delphi

I would like to create a stacked bars chart with TDBChart using a single dataset.
As far as i can see if I use TDBChart as i choose a stacked chart 2 series are added.
This component seems good to create stacked charts from many datasets, in which each dataset contains data of a specific type.
I make an example to clarify:
let's say I have a dataset (dtsSalesAllCountries) with the following info:
country
year
total_sales
in this way in principle i could plot a stacked bars chart in which I see bar per year and the total_sales for each country are stacked.
But TDBChart does this through series, so to perform my result i am currently forced to create one series per country (sqlFranceSales, sqlItalysales, sqlIndiaSales, ...)
This is quite unconvenient, each time i sell to a new country i must add a dataset. This is how it looks like with this implementation:
Please note I need to use TDBChart since I use ReportBuilder/TeeChart integration, that is based on TDBChart.
In fact what i am looking for is a pivot chart, that is not available in the Report Builder/TeeChart integration.
Is there a way with TDBCHart to achieve the stacked bars sales chart i am trying to implement using a single dataset and not one dataset per series?

For TChart itself you would configure the Data Source for the Series as a CrossTab. The extra series will then be created for you. Not sure if it can be done with TCharts embedded in ReportBuilder reports.
With source data from SQL Server:
SELECT * FROM (VALUES ('CA',2012,2500),('US',2012,5600)
,('CA',2013,3000),('US',2013,7000)
,('CA',2014,2600),('US',2014,8000))
AS A(Country,Year,Sales)
Produces:

Related

Highchart Scatter Series must appear in front of the column series, but if it contains more than 5k records, it appears at the back of column series

Chart as three columns series with stacking on top and one scatter series with over 5k records. So, in the front view, we need to see the scatter first, followed by the subsequent column series. It works perfectly with less than 5k records, but if there are more than 5k, the columns chart falls back.
Demo
Expecting Series must appear in front of the column series
For large amounts of data you can use Highcharts Boost module, add to this script to your project:
<script src="https://code.highcharts.com/modules/boost.js"></script>
Blog article explain how to work with boost module:
https://www.highcharts.com/docs/advanced-chart-features/boost-module

Google Sheets: Swap X and Y Axis in Chart

I am trying to illustrate the twist in a sail using a chart, showing the effect of various twist amounts.
However, try as I might, I cannot swap the x and y axis! The cells B3:B8 are the height going up the sail, where the measurements were taken, and should be the y-axis.
The columns C:V are series, which are different sets of measurements taken at the various heights up the sail, with the degree of twist as the series' values. This is what I have:
I've also tried to create the chart from Transpose()d data (swapped rows <-> cols) but ended up with the same chart! The "Height" is supposed to be the Y-axis, and the values ("Degrees") the X-axis.
I must be missing something obvious, but Google is not my friend today. I have created a sample Spreadsheet here if anyone can help. MTIA.
Currently it is not possible to define the Y-Axis to a specific range for Smooth Line Chart, in fact, the only way this can be defined is by using Bar Chart.
As a workaround, you can use Bar Chart to define the Y-Axis like this:
Please note that it only looks best when displaying one or two series, the bars would look squished when more series are added.
As for the original intention of defining Y-axis for Line Charts, or a completely new type of chart, you can file a feature idea request here:
How To Submit a Feature Idea Request
Google Workspace Feature Idea Request Link

Highcharts compare different dates ranges

I'd like to use highstock to compare two different time ranges together.
For example, for two data sets, one that shows the max temp for each day in Jan and the other one for Feb (for example), I'd like them to be shown one above the other, with the x-axis being the "same" one for both.
I can't do it with categories, because the data is being fed automatically, so each data point has its own time, so the x-axis is datetime.
I wanted to know if it was possible to simply have two graphs overlapping, with one graph having the normal x-axis at the bottom, and the other one having on top of the graph, so even when the data is for different times, it's shown overlapping. I can't find this problem anywhere.
Found the answer on this thread. Hope it helps!
Overlay 2 series of data of different length with highcharts
Essential Chart can be used with different date ranges with multiple axes. example source
The community license provides the whole suite of products for free if you qualify.
Note: I work for Syncfusion.

Waterfall with two series using Highcharts

I'm trying to set two Waterfall series using Highcharts in the same chart, I have only see one serie in this type of chart in Highcharts samples. I have manipulate the data to be an array but still not working.
I mean two independent waterfall series (one next to each other no-stacked) , like column chart. Like this one (http://img854.imageshack.us/img854/6886/qghm.png)

Adding multiple dynamic series and axes via JSON into Highcharts

Like many Highstock users, our data is retrieved from a database by way of Ajax queries. The series data sets are all time-based, but have different purposes and data ranges.
I can add multiple series to the chart no problem. Works great. However, how can I dynamically (emphasis on dynamically) add companion axes to these series (axis title and range)? I've scoured the documentation and forums but can't figure out exactly how to associate the new axis with the new series.
Thanks!
The only way to do this (as far as I know) is to add multiple empty axes to your chart, and then set them programmatically. It's a hack - but it works:
http://livecoding.io/3431916

Resources