Published
Edited
Sep 30, 2020
1 fork
Insert cell
md`# 2D Line Graph`
Insert cell
Insert cell
Insert cell
Insert cell
dataSample = [
{"u": 1, "v": 28}, {"u": 2, "v": 55},
{"u": 3, "v": 42}, {"u": 4, "v": 34},
{"u": 5, "v": 36}, {"u": 6, "v": 48}
]
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
LineGraph_3= LineMark({title:"Line Graph with zero set to false",values:dataSample,fieldx:"u",fieldy:"v",zero:false})
Insert cell
Insert cell
LineGraph_4= LineMark({title:"my Line Graph",values:dataSample,fieldx:"u",fieldy:"v",zero:false})
Insert cell
LineGraph_5= LineMark({title:"my Line Graph",fieldx:"date",fieldy:"close",zero:false})
Insert cell
Insert cell
Insert cell
Insert cell
theRates = InspectData('https://marketdata.tradermade.com/api/v1/timeseries?api_key=owKzCjjxp3n-SjZBHVWW&currency=USDIDR&start_date=2019-10-01&end_date=2019-10-10&format=records',{type:"json",property:"quotes"})
Insert cell
theArg = ({name:"theRates",
url:"https://marketdata.tradermade.com/api/v1/timeseries?api_key=owKzCjjxp3n-SjZBHVWW&currency=USDIDR&start_date=2019-10-01&end_date=2019-10-10&format=records",
format:{type:"json",property:"quotes",parse:{"date":"date:'%Y-%m-%d'"}}})
Insert cell
theRates2 = InspectData(theArg)
Insert cell
md`### Libraries and Tools`
Insert cell
import {VegaSpec, data, scales, axes,marks} from '@binarmaya/top-level-vega-spec'
Insert cell
embed = require("vega-embed@6")
Insert cell
import {InspectData} from '@binarmaya/parse-transform-and-inspect-vega-data'
Insert cell
spex = {
var spes = new VegaSpec()
spes.scales = [new scales({name:"x",type:"linear"})]
spes.scales[0]['type'] = "time"
return spes
}
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more