César
César

Reputation: 10119

How to create a chart with X and Y as strings?

I want the X axis to be a list of job descriptions, and the Y axis to be a list of worker names. Something like this:

enter image description here

I'm trying to do something like this:

var categoriesX = ["Job1", "Job2", ...];
var categoriesY = ["Dude1", "Dude2", ...];
$(chartId).highcharts({
    // Don't know what kind of chart I should use
    ...
    xAxis: {
        categories: categoriesX,    
        title: {
            text: null
        }
    },
    yAxis: {
        categories: categoriesY,
        title: {
            text: null,
        },
    }
    ...
}

But then, how can I render the values using (x,y) notation if x and y are strings. Is it posible? Is there a better approach?

Note:

I know I can do this using some kind of dynamic HTML table, but I have other charts in the same page and I want this one to be a chart too.


Cross-post on Stack Overflow in Spanish

Upvotes: 0

Views: 103

Answers (1)

César
César

Reputation: 10119

Ok, the answer was giving to me from the answer by Javier Cárdenas on SO in Spanish.

Using a chart of type heatmap:

enter image description here

Here's the fiddle.

Upvotes: 1

Related Questions