Sparkline problems

Hi, I have a few sparkline questions…the Polymer example at https://vaadin.com/elements/-/element/vaadin-sparkline references stockData.json. Where is this data? Can you give me the full URL so I can take a look and see how the items should be formatted? The above sparkline code is for Polymer 1.0 right? Also, is that that code still current? There is the following note in that example code “//TODO fix when styling has been fixed”; has styling been fixed yet?

Your help is appreciated, thanks!
Mona

Hi Mona,

Looks like that example is outdated. I’ll fix that asap. In the meantime take a look at the
online demo
in the menu under the category ‘Other’ you’ll find “Sparkline Example with Large Dataset” with the latest demo and it’s source in the source tab.

Regarding the data, it’s the data-series data, so an array is good enough for a line chart. You can find the example and data file in github:

Demo Source
Sample Data File

Hope this helps,

Guille

I am also working with the sparkline demo and have two questions:

  1. everything is loading and displaying properly but I get this error:vaadin-grid.html:986 Uncaught Error: Unknown items type: [object Object]
    . Only arrays and functions are supported. I would like to address it but not sure where it arises

  2. I would like to add the grid filter and sort functionality but the sample grid code will not work within an element. what are the adjustments that need to be made to the following:

var filterInput = document.querySelector(‘#filter’); filterInput.addEventListener(‘value-changed’, function() { var filterText = filterInput.value.toLowerCase(); grid.items = users.filter(function(val) { if (filterText) { return (val.firstName.toLowerCase()).indexOf(filterText) > -1; } else { return true; } }); });
? Thanks