cube-js / cube-js/cube

Unable to use shortTitle in .series()

Open
#673 3 comments 2 reactions 0 assignees View on GitHub
client:core help wanted
Dominant language
Rust
Stars
20.8k
Forks
2.1k
Avg merge
1d 5h
Merged PRs (30d)
193

Description

In my ChartRenderer.js I was able to use `shortTitle` as seen below to remove the database prefix off of my table (antd) column titles.

```
table: ({ resultSet }) => (
({ title: c.shortTitle, key: c.key, dataIndex: c.key }))}
dataSource={resultSet.tablePivot()}
/>
)
```

When attempting to use this on my bar graph (chartjs) I was unable to get a similar result.

```
bar: ({ resultSet }) => {
const data = {
labels: resultSet.categories().map(c => c.category),
datasets: resultSet.series().map((s, index) => ({
label: s.shortTitle,
data: s.series.map(r => r.value),
backgroundColor: COLORS_SERIES[index],
fill: false
}))
};
const options = {
scales: {
xAxes: [
{
stacked: true
}
]
}
};
return ;
```

here is where I am hoping to expose shortTitle:
https://github.com/cube-js/cube.js/blob/master/packages/cubejs-client-core/src/ResultSet.js#L74-L80

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.