ChartSQL
AboutProductDownloadCommunity
  • Basics
    • Intro
    • Quick Start
  • CHARTS
    • Overview
    • Auto Charts
    • Area
    • Bar
    • Bubble
    • Column
    • Combo
    • Gauge
    • Heatmap
    • Line
    • Pie
    • Radar
    • Scatter
    • Formatting & Rendering
      • Baselines
      • Formats
      • Series Titles
      • Series Labels
      • Stacked Charts
      • Grouped Category
  • ChartSQL Studio
    • Overview
    • ChartSQL Studio Cloud
    • Installing Studio Desktop
    • Basic Concepts
      • Interface Overview
      • Workspace
      • SQL Scripts & Charts
      • Folders
      • Datasources
      • Thinking in ChartSQL
    • Creating Charts
      • Editor Panels
      • Column Data Types
      • Chart Types
      • Directives
      • Stacking
      • Baselines
      • Series Titles
      • Dynamic SQL Charts
      • Dynamic Data Functions
    • Presenting
    • Settings & Customization
    • Troubleshooting & Support
    • Datasources
      • Overview
      • CSV File
      • HyperSQL
      • MongoDB
      • MySQL
      • PostgreSQL
      • SQLite
      • Custom Datasources
    • Extensions
      • Overview
      • Extension Points
      • Core Extensions
      • Extensions API Reference
  • Dashboards
    • Coming Soon
  • ChartSQL JS
    • Coming Soon
  • Reference
    • Auto Charts
    • Directives
      • @baselines
      • @baseline-types
      • @chart
      • @category
      • @formats
      • @series
      • @title
      • @subtitle
      • @groups
      • @series-types
      • @series-labels
      • @stacking-mode
      • //@directive: comments
      • @dash-id
      • @overlay-series
      • @tags
      • @select-list
    • Glossary
    • Shortcuts
    • Publishing API
  • Product & Community
    • About
    • Features
    • Use Cases
      • General Uses
      • For SQL Developers
      • For Application Developers
      • For Agencies
      • For Data Science Teams
    • Community & Support
    • Roadmap
    • Release Notes
    • In Development
      • Workspaces
      • Dashboards
        • Intro
        • Dashboards
        • Packages
        • Pages
        • Charts
        • Access Control
      • Sharing & Publishing
      • ChartSQL.js
        • Overview
      • @threshold
      • Thresholds
      • Sheets
Powered by GitBook

Support

  • Discord
  • X

ChartSQL

On this page
  • Quick Reference
  • Valid Values
  • Full Example
  • Use Cases

Was this helpful?

  1. Reference
  2. Directives

@series

Comma separated list of columns to use for data on the chart

Quick Reference

-- @series: sales, profit

Valid Values

List

A comma separated list of column names from the result set that should be displayed on the chart

Full Example

-- @chart: column
-- @title: Series - Basic chart
-- @subtitle: An example of explicitly defining the @series
-- @series: Sales
-- @formats: currency
SELECT 
	TRUNC(date_closed, 'MONTH') as Month,
	sum(amount) as Sales,
    sum(Profit) as Profit
FROM sales
GROUP BY TRUNC(date_closed, 'MONTH')
ORDER BY TRUNC(date_closed, 'MONTH') ASC;
MONTH
SALES
PROFIT

January, 01 2017 00:00:00 +0000

2668855.0

801583.0

February, 01 2017 00:00:00 +0000

3951547.0

1117761.0

March, 01 2017 00:00:00 +0000

4403443.0

1224108.0

April, 01 2017 00:00:00 +0000

3079040.0

862533.0

May, 01 2017 00:00:00 +0000

2576305.0

631699.0

June, 01 2017 00:00:00 +0000

3100093.0

870893.0

July, 01 2017 00:00:00 +0000

3112476.0

871875.0

August, 01 2017 00:00:00 +0000

4980193.0

1321417.0

Use Cases

You use @series when you need to explicitly control which columns are going to be rendered on the chart. Typically this is necessary when your SQL returns more columns than you wish to display.

Previous@formatsNext@title

Last updated 1 year ago

Was this helpful?

An example chart with an explicitly defined series. Columns not added are ignored