HI,
Thanks for the detailed answer. I am able to progress a bit. Now I can see the x-axis with dates. But still I am not able to get a simple line graph. Below is my json and sample csv file. Could you please tell me what am I missing? I don't see any errors in browser console. My followup question would be what are the tips to debug such issues?
regards
Hrishikesh
{
"width": 700,
"height": 200,
"padding": {"top": 10, "left": 30, "bottom": 30, "right": 20},
"data": [
{
"name": "table",
"url":"./data/temp.csv",
"format": {"type":"csv", "parse":{"date":"date:\"%d-%b-%y\"", "temp":"number"}}
}
],
"scales": [
{
"name": "x",
"type": "time",
"range": "width",
"nice" : "month",
"domain": {"data": "table", "field": "date"}
},
{
"name": "y",
"type": "linear",
"range": "height",
"nice": true,
"domain": {"data": "table", "field": "temp"}
}
],
"axes": [
{"type": "x","scale": "x"},
{"type": "y", "scale": "y"}
],
"marks": [
{
"type": "line",
"from": {"data": "table"},
"properties": {
"enter": {
"x": {"scale": "x", "field": "date"},
"y": {"scale": "y", "field": "temp"}
}
}
}
]
}
sample csv data
=====
date,temp
10-May-12,58.13
30-Apr-12,53.98
27-Apr-12,37
26-Apr-12,39.7
25-Apr-12,20
24-Apr-12,30.28
23-Apr-12,16.7
20-Apr-12,34.98
19-Apr-12,34.44