Knowledge Base Article
To modify the color of the sparkline, search for this piece of code in the Editor. You can then modify the line-color, fill-color, and point-color. You can also modify other parameters such as the width of the graph.
What other parameters are there for the Sparkline? You mention a few above, and there's a few that show up automatically when you use the "Indicator Sparkline" template. Some slightly different ones show up if you instead copy from the Sparkline Chart "snippet" (e.g. min-point-color and max-point-color).
I'm trying to figure out what else we can modify or customize with the Sparkline. For instance, can we change the vertical scale of the chart? Like, not the actual size on the screen, but the axis of the chart, like what the minimum Y value is. By default it shows the lowest value in the chart as the minimum, but what if we want the chart to always be anchored to zero for the minimum?
Also, what values do the different parameters support? One of them is type, which by default is set to "type='line'". I noticed you can change that to "type='bar'" to get a bar chart instead. What other chart types are supported? I tried "column" and "area" but those didn't do anything. After googling around a bit, I also saw something about a "winloss" chart but that value didn't work either. Are "line" and "bar" the only supported values here, or are there more? If so, where is this documented? Is there a reference of some sort that I can consult? (Note: I already checked the Sisense BloX Reference but the entry on Sparkline Charts only mentions the overall <span> element, and does not explain any of the parameters within.)
EDIT - Here's what I've surmised from combining the various different sources (template code, code snippet, examples of code on various pages...)
Parameter | Example | My notes |
fill-color | fill-color='#B2D4DF' | For line charts, this is the color of the area underneath the line. Not sure if this applies to bar charts. |
height | height='50' | Controls the height of the sparkline element itself (how tall the chart is) |
line-color | line-color='#117899' | Color of the line on the sparkline. Not sure if this applies to bar charts. |
line-width | line-width='3' | How thick the line on the sparkline is. Not sure if this applies to bar charts. |
point-color | point-color='#117899' | Unclear what this controls. Judging by the name you would think this sets the default color for all points, but that's not the case. Instead, it seems to only affect the color of the last point on the chart? Like, not the min or max, but just the right-most point. |
max-point-color | max-point-color='#000000' | Controls the color of the max point (highest value in chart) |
min-point-color | min-point-color='#000000' | Controls the color of the min point (lowest value in chart) |
type | type='line' | Main parameter that controls what kind of graph is used for the sparkline. Default seems to be 'line', but you can also use 'bar' for a vertical bar chart. |
width | width='200' | Controls the width of the sparkline element itself (how long the chart is) |
I'm wondering if there's more possible parameters, though, given the other elements in the sparkline. For instance, is it possible to set the formatting for hover-over text? Or, when you hover over a point, the point on the line is highlighted a certain color (seems to be green by default), and there's also a vertical line that appears and intersects with the point (seems to be red by default). Can you change these? Can these perhaps be changed in a different area, like in the "Configuration" tab (i.e. where all the CSS stuff is)?
Also, since you can change the chart 'type' from line to bar, I'm wondering if there are entirely different parameters for bar charts, since things like "line-width" wouldn't apply.