Open
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 }) => (
<Table
pagination={false}
columns={resultSet.tableColumns().map(c => ({ 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 <Bar data={data} options={options} />;
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