AntonioLoureiro / ECharts.jl

Other
2 stars 0 forks source link
echarts julia julia-language visualization

ECharts.jl

Julia Library that wraps fully the ECharts (Baidu) JS Library

The library is very thin and fast, and fully passes all args to ECharts API

See ECharts Demos in: https://ecomfe.github.io/echarts-examples/public/index.html

See ECharts API in: https://ecomfe.github.io/echarts-doc/public/en/option.html

Examples

using ECharts,DataFrames
#### Create Random DataFrame
points=50
df=DataFrame()
df[:x]=rand(points)*100
df[:y]=rand(points)*10
df[:series]=rand(["SerieA","SerieB"],points)
df[:symbolSize]=rand(10:1:25,points)
head(df)
xyseriessymbolSize
131.842709245964331.1291218016205407SerieB25
29.519353233108240.7565851121855416SerieB19
374.790626478706336.802525807551829SerieA20
428.6701346131699181.063095167149788SerieB22
575.856400603668020.7252974837492654SerieB17
688.83919201004351.1211873678638784SerieA17
## simple Chart using series helper sintax
EChart(ctype="scatter",x=df[:x],y=df[:y],series=df[:series],symbolSize=df[:symbolSize])

Chart1

## simple Chart using series helper sintax
EChart(ctype="pie",x=[1000,2000,3300],names=["A","B","C"])

Chart2

## Fully customized Chart using API sintax
ECharts.EChart(Dict(
        "legend"=>Dict("data"=>["S1","S2","S3"]),
        "xAxis"=>Dict("type"=>"category","data"=>["X1","X2","X3","X4","X5"]),
        "yAxis"=>[Dict("type"=>"value","name"=>"Amount"),Dict("type"=>"value","name"=>"Number")],
        "series"=>[
            Dict("type"=>"bar","name"=>"S1","stack"=>"s","data"=>[100,200,350,920,700]),
            Dict("type"=>"bar","name"=>"S2","stack"=>"s","data"=>[60,120,50,30,40]),
            Dict("type"=>"line","name"=>"S3","yAxisIndex"=>1,"data"=>[10,90,80,40,100])
            ]
        ))

Chart3