Skip yAxis gridLines if there is no data in them - highcharts

I am trying to create a simple chart where xAxis is the date the user selected an attribute while yAxis is the attribute the user selected.
Each attribute corresponds to a value starting from 0. So for example, attribute0 has a value of 0 and so on.
What i would like to do is to not display yAxis grid lines for attributes that were not selected by the user.
As can be seen in the screenshot the user has selected attributes 3,4,5 and 9. The problem is that i don't want to show yAxis grid lines for the rest of the attributes(1,2,6,7 and 8) while preserving the value of the displayed attributes. This means that i want attribute 9 to have a value of 9 even if it is displayed in line 4 in this example(assuming that there is a way to skip empty gridLines)
The end result i would like to be like this for this example.
If the user selects a new attribute the next day, one that does not already exists in the graph, this attribute should be added in the same way.
Any ideas?
I hope i am explaining my self correctly.
Thank you in advance.

You can do this by using categories on the y axis.
Your y values then need to be the category index of the selected value, rather than the value itself.
So, in your example, you would have:
categories = ['3','4','5','9']
And the y values for that would be 0,1,2,3 instead of 3,4,5,9.
Something like (random x value used):
data: [[100,0],[100,1],[100,2],[100,3]]
Example:
http://jsfiddle.net/3d3fuhbb/62/

Related

Filter out entire row based on one result in Tableau

Learning Tableau through tutorials so bear with me.
I have a list I need to filter, but when I set up a calculated field, it only filters out a single cell, not the whole row.
Here's the example I made:
1
In this table, I want to filter out entire rows that have negative values. Alice and Bob would be hidden, but Cat and Dee would remain.
When I add a (IF SCORE <0 THEN 0 ELSE 1 END) filter, I only filter out that single value, not the whole row. Example:
2
How do I write a calc to hide the rows with negatives?
Sorry i cannot recreate your example, but i used one of my use cases.
just drag "name" to the filter pane and in the filter options go to conditions
there you need to apply the logic of Value > 0
This will make the rows disappear. Hope this helps

Way to make a pie chart using sum of certain cells in a column based on the tags in another column

I have a spreadsheet set up as a type of checkbook and I was wondering if given a column called "Amount" which records the various dollar amounts of the individual transatction. And another column "Reason" which the reason for a transaction is written down "rent, eating out, etc". Could I make a pie chart that will add all of the values that are in the Amount column if they have matching reasons in the Reason column.
So if I have five Reason entries listed as "rent" can I then get the sum of each cell from the Amount column that is in the same row.
Essentially I want to have a resulting chart that shows the total I'm spending on each reason with the labels that match the reason category.
--Edit
Heres an image of how my spreadsheet is set up currently with the solution of using filters to make a bar chart but I wonder if there's a better way to do this
Create a chart with Columns A (Amount) and B (Reason).
Create a filter with Column B (Reason)
Select/deselect the reason you want to include
You may also consider to filter with a slicer

A different suffix from an array for each line on Highcharts

What I need is to show a different valuesuffix for each chart type value based on a unique array for each series.
I have considered the answer in this question and created this jsfiddle.a
It will only work when the tooltip is displayed for one series at a time. If I set the series tooltip to be shareda, it will not work.
Any ideas?
For tooltip shared with multiple series, you need to loop the points like this in order for the tooltip to work.
Edited: Added valuePrefix

Show empty series in highcharts

I can't seem to show the series with empty data into my highcharts. I have some check-ins in a graph for each of the 7 weekdays. But when a day doesn't have data, it's hidden. What I would like to do is show the label of the empty serie on the x-axis (print the weekday name). I tried to populate my data with null values, using different options for highcharts, ...
I also can't set the color for the columns, I tried setting it to gray but that doesn't work.
Here's a demo in JSFiddle
You can set min and max for yAxis, instead of minPadding and maxPadding, take a look: http://jsfiddle.net/tgZcc/21/

Custom plotting

I have to create controls based on an object that I'm getting from a db call. The object can be anything, so the chart has to be created dynamically. To illustrate my issue lets say that the object looks like
var obj = [{name:"int",data:[2,5,8,11,12]},
{name:"double",data:[1.1,4.1,7.1,10.1,11]}]
After parsing the obj the user can select what they want to plot. Whether they want to see int or double on the x/y Axis. Then plot the series they want to see. My issue is that every time I plot the series no matter how I format it plots the series with the yAxis and the value's array index on the xAxis. How could I make it so the user can plot the int/double relation using either series? Thanks.
So you can use select html obejct, then catch select event and i.e addSeries() function to chart.
http://api.highcharts.com/highcharts#Chart.addSeries()

Resources