Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Line chart without the y-axis #23

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 95 additions & 0 deletions Line chart without the y-axis
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
CustomChart {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please create a sub directory for your files, e.g:

  • line_chart_without_yaxis/line_chart_without_yaxis.vgl.aml
  • line_chart_without_yaxis/README.md

fields {
field date {
type: "dimension"
label: "Date"
data_type: "date"
}
field measure {
type: "measure"
label: "Measure"
}
field legend {
type: "dimension"
label: "Legend"
}
}

options {
option legend {
type: 'toggle'
label: 'Hide Legend'
default_value: false
},
option tooltip {
type: 'toggle'
label: 'Show Tooltip'
default_value: true
}
}

template: @vgl {
"data": {
"values": @{values}
},

"mark": {
"type": "line",
"tooltip": @{options.tooltip.value}
},

"encoding": {
"x": {
"field": @{fields.date.name},
"type": "temporal",
"title": null,
"axis": {
"grid": false,
"labelFont": "Inter",
"labelColor": "#858b9e",
"labelFontSize": 11,
"domainColor": "#bec1cb",
"tickColor": "#bec1cb"
}
},
"y": {
"field": @{fields.measure.name},
"type": "quantitative",
"title": null,
"axis": {
"labels": false,
"domain": false,
"grid": false,
"ticks": false
}
},
"color": {
"field": @{fields.legend.name},
"type": "nominal",
"legend": {
"disable": @{options.legend.value},
"titleFont": "Inter",
"titleFontSize": 11,
"titleFontWeight": "bold",
"labelColor": "#858b9e",
"labelFont": "Inter",
"labelFontSize": 11,
}
}
},
"config": {
"background": "transparent",
"view": {"stroke": null},
"range": {
"category": [
"#255dd4",
"#18a59e",
"#07326c",
"#af7ded",
"#a50e43",
"#f2b602"
]
}
}
};;
}
13 changes: 13 additions & 0 deletions README(line chart without y axis).md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Line chart without y-axis
A custom chart based on the concept of a basic line chart but without showcasing the y axis in the final visual.

## Fields
* Date
* Measure
* Legend

## Options
* Hide or Show Legend and Tooltip

## Code
[linechartwithoutyaxis_code](https://github.com/poojamini/custom-chart-library/blob/patch-1/Line%20chart%20without%20the%20y-axis)