Replies: 3 comments 1 reply
-
|
This is incorrect - the legend is only rendered if there are 2 or more series, not 3. It can't be enabled for a single (1) series. |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Hmmm. In Google Chrome on my Windows PC, this example shows no legend: demo: https://tattered-spiral-scilla.glitch.me/ code: import { worker } from 'https://cdn.jsdelivr.net/npm/@finos/perspective@latest/dist/cdn/perspective.js'
const WORKER = worker()
const REQ = fetch('https://api.covidtracking.com/v1/states/daily.csv')
const LAYOUT = {
plugin: 'X/Y Line',
plugin_config: {
legend: {
height: '106px',
left: '100px',
top: '25px',
width: ''
}
},
settings: true,
group_by: ['Parsed "date" bucket by week'],
split_by: ['state'],
columns: ['Parsed "date" bucket by week', 'deathIncrease'],
filter: [['state', 'in', ['NY', 'CA']]],
sort: [['deathIncrease', 'col desc']],
expressions: [
`// Parsed "date" bucket by week
var year := integer(floor("date" / 10000));
var month := integer(floor("date" / 100)) - year * 100;
var day := integer("date" % 100);
bucket(date(year, month, day), \'W\')`
],
aggregates: { 'Parsed "date" bucket by week': 'first' }
}
async function load () {
const resp = await REQ
const csv = await resp.text()
const el = document.getElementsByTagName('perspective-viewer')[0]
const table = WORKER.table(csv)
let plugin = await el.getPlugin('Y Area')
el.load(table)
el.restore(LAYOUT)
el.toggleConfig()
plugin.max_cells = 10000000
plugin.max_columns = 10000000
}
window.addEventListener('DOMContentLoaded', load) |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Thanks for the repo @riziles, very helpful. This looks like a bug in Tracking #2106 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
When using the x/y Line, the Legend will automatically disappear if there are less than three items. Is there a way to force it to be visible?
Beta Was this translation helpful? Give feedback.
All reactions