You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@echarts.apache.org by "Svenberg, Tobias" <to...@sweco.se> on 2019/03/21 16:28:39 UTC

Question regarding hiding bars in barchart

Hello,

I've tried to figure this one out but have hit a dead end. The option below creates a lot of empty space on the xAxis. This is, I assume the space taken by empty values. Is there a way to hide/skip these null bars?

[cid:image001.jpg@01D4E00B.84CB8720]


option = {
            legend: {
                type: 'scroll',
                orient: 'vertical',
                right: 10,
                top: 20,
                bottom: 20,
            },
            tooltip: {
                trigger: 'axis',
                // showContent: false
            },
            dataset: {
                sourceHeader: true,
                source: [
                    ['Tenant','Plan 01','Plan 02','Plan 03','Plan 04','Plan 05','Plan 06','Plan 07','Plan 08','Plan 09','Plan 10'],
                    ['Real Estate Service',327.15,,null,null,null,null,null,null,null,null],
                    ['Zeus Navigations',null,78.99,null,27.09,46.89,null,null,null,null,null],
                    ['Vacant',null,42.29,null,69.39,null,null,null,83.69,26.71,null],
                    ['Golden Road Corporation',null,33,null,null,null,null,null,null,null,null],
                    ['Twister Foods',null,34.11,null,null,null,null,null,null,null,null],
                    ['Melonetworks',null,null,69.39,null,null,null,null,null,27.08,null],
                    ['Antarts',null,null,33.33,null,null,null,null,null,null,null],
                    ['Spicurity',null,null,33.33,null,null,null,null,null,null,null],
                    ['Surprisystems',null,null,null,null,52.29,46.89,null,null,null,null],
                    ['Soulstones',null,null,null,null,null,52.29,null,null,null,null],
                    ['Signalways',null,null,null,null,null,null,46.89,null,null,null],
                    ['Shadowshade',null,null,null,null,null,null,52.29,null,null,null],
                    ['Star Gazer',null,null,null,null,null,null,null,null,null,26.71]
                ],


            },
            xAxis: {type: 'category'},
            yAxis:{},

            series: [
                // // // These series is in the first cartesian (grid), and each
                // // // is mapped to a row.
                {type: 'bar', seriesLayoutBy: 'row'},
                {type: 'bar', seriesLayoutBy: 'row'},
                {type: 'bar', seriesLayoutBy: 'row'},
                {type: 'bar', seriesLayoutBy: 'row'},
                {type: 'bar', seriesLayoutBy: 'row'},
                {type: 'bar', seriesLayoutBy: 'row'},
                {type: 'bar', seriesLayoutBy: 'row'},
                {type: 'bar', seriesLayoutBy: 'row'},
                {type: 'bar', seriesLayoutBy: 'row'},
                {type: 'bar', seriesLayoutBy: 'row'},
                {type: 'bar', seriesLayoutBy: 'row'},
                {type: 'bar', seriesLayoutBy: 'row'},
                {type: 'bar', seriesLayoutBy: 'row'},
            ]
        };


Thank you!


Best regards,

Tobias Svenberg

Re: Question regarding hiding bars in barchart

Posted by Dave Fisher <wa...@apache.org>.
Added the OP who is not subscribed.

Tobias - The list strips attachments. You may want to upload to a post service and provide the link.

You also may wish to subscribe by sending an email to dev-subscribe@echarts.apache.org <ma...@echarts.apache.org> 

Regards,
Dave

> On Mar 21, 2019, at 9:28 AM, Svenberg, Tobias <to...@sweco.se> wrote:
> 
> Hello,
>  
> I’ve tried to figure this one out but have hit a dead end. The option below creates a lot of empty space on the xAxis. This is, I assume the space taken by empty values. Is there a way to hide/skip these null bars?
>  
> 
>  
>  
> option = {
>             legend: {
>                 type: 'scroll',
>                 orient: 'vertical',
>                 right: 10,
>                 top: 20,
>                 bottom: 20,
>             },
>             tooltip: {
>                 trigger: 'axis',
>                 // showContent: false
>             },
>             dataset: {
>                 sourceHeader: true,
>                 source: [
>                     ['Tenant','Plan 01','Plan 02','Plan 03','Plan 04','Plan 05','Plan 06','Plan 07','Plan 08','Plan 09','Plan 10'],
>                     ['Real Estate Service',327.15,,null,null,null,null,null,null,null,null],
>                     ['Zeus Navigations',null,78.99,null,27.09,46.89,null,null,null,null,null],
>                     ['Vacant',null,42.29,null,69.39,null,null,null,83.69,26.71,null],
>                     ['Golden Road Corporation',null,33,null,null,null,null,null,null,null,null],
>                     ['Twister Foods',null,34.11,null,null,null,null,null,null,null,null],
>                     ['Melonetworks',null,null,69.39,null,null,null,null,null,27.08,null],
>                     ['Antarts',null,null,33.33,null,null,null,null,null,null,null],
>                     ['Spicurity',null,null,33.33,null,null,null,null,null,null,null],
>                     ['Surprisystems',null,null,null,null,52.29,46.89,null,null,null,null],
>                     ['Soulstones',null,null,null,null,null,52.29,null,null,null,null],
>                     ['Signalways',null,null,null,null,null,null,46.89,null,null,null],
>                     ['Shadowshade',null,null,null,null,null,null,52.29,null,null,null],
>                     ['Star Gazer',null,null,null,null,null,null,null,null,null,26.71]
>                 ],
>                 
>                 
>             },
>             xAxis: {type: 'category'},
>             yAxis:{},
>  
>             series: [
>                 // // // These series is in the first cartesian (grid), and each
>                 // // // is mapped to a row.
>                 {type: 'bar', seriesLayoutBy: 'row'},
>                 {type: 'bar', seriesLayoutBy: 'row'},
>                 {type: 'bar', seriesLayoutBy: 'row'},
>                 {type: 'bar', seriesLayoutBy: 'row'},
>                 {type: 'bar', seriesLayoutBy: 'row'},
>                 {type: 'bar', seriesLayoutBy: 'row'},
>                 {type: 'bar', seriesLayoutBy: 'row'},
>                 {type: 'bar', seriesLayoutBy: 'row'},
>                 {type: 'bar', seriesLayoutBy: 'row'},
>                 {type: 'bar', seriesLayoutBy: 'row'},
>                 {type: 'bar', seriesLayoutBy: 'row'},
>                 {type: 'bar', seriesLayoutBy: 'row'},
>                 {type: 'bar', seriesLayoutBy: 'row'},
>             ]
>         };
>  
>  
> Thank you!
>  
>  
> Best regards,
>  
> Tobias Svenberg


Re: Question regarding hiding bars in barchart

Posted by Dave Fisher <da...@comcast.net>.
Making sure Tobias is included since he probably is not subscribed.

Sent from my iPhone

> On Mar 21, 2019, at 7:29 PM, Ovilia <ov...@gmail.com> wrote:
> 
> Hi Tobias.
> 
> This is a feature that ECharts does not support yet. Please follow
> https://github.com/apache/incubator-echarts/issues/9899 for more
> information.
> 
> Zhang Wenli
> http://zhangwenli.com
> 
> 
> Svenberg, Tobias <to...@sweco.se> 于2019年3月22日周五 上午12:31写道:
> 
>> Hello,
>> 
>> 
>> 
>> I’ve tried to figure this one out but have hit a dead end. The option
>> below creates a lot of empty space on the xAxis. This is, I assume the
>> space taken by empty values. Is there a way to hide/skip these null bars?
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> option = {
>> 
>>            legend: {
>> 
>>                type: 'scroll',
>> 
>>                orient: 'vertical',
>> 
>>                right: 10,
>> 
>>                top: 20,
>> 
>>                bottom: 20,
>> 
>>            },
>> 
>>            tooltip: {
>> 
>>                trigger: 'axis',
>> 
>>                // showContent: false
>> 
>>            },
>> 
>>            dataset: {
>> 
>>                sourceHeader: true,
>> 
>>                source: [
>> 
>>                    ['Tenant','Plan 01','Plan 02','Plan 03','Plan
>> 04','Plan 05','Plan 06','Plan 07','Plan 08','Plan 09','Plan 10'],
>> 
>>                    ['Real Estate
>> Service',327.15,,null,null,null,null,null,null,null,null],
>> 
>>                    ['Zeus
>> Navigations',null,78.99,null,27.09,46.89,null,null,null,null,null],
>> 
>> 
>> ['Vacant',null,42.29,null,69.39,null,null,null,83.69,26.71,null],
>> 
>>                    ['Golden Road
>> Corporation',null,33,null,null,null,null,null,null,null,null],
>> 
>>                    ['Twister
>> Foods',null,34.11,null,null,null,null,null,null,null,null],
>> 
>> 
>> ['Melonetworks',null,null,69.39,null,null,null,null,null,27.08,null],
>> 
>> 
>> ['Antarts',null,null,33.33,null,null,null,null,null,null,null],
>> 
>> 
>> ['Spicurity',null,null,33.33,null,null,null,null,null,null,null],
>> 
>> 
>> ['Surprisystems',null,null,null,null,52.29,46.89,null,null,null,null],
>> 
>> 
>> ['Soulstones',null,null,null,null,null,52.29,null,null,null,null],
>> 
>> 
>> ['Signalways',null,null,null,null,null,null,46.89,null,null,null],
>> 
>> 
>> ['Shadowshade',null,null,null,null,null,null,52.29,null,null,null],
>> 
>>                    ['Star
>> Gazer',null,null,null,null,null,null,null,null,null,26.71]
>> 
>>                ],
>> 
>> 
>> 
>> 
>> 
>>            },
>> 
>>            xAxis: {type: 'category'},
>> 
>>            yAxis:{},
>> 
>> 
>> 
>>            series: [
>> 
>>                // // // These series is in the first cartesian (grid),
>> and each
>> 
>>                // // // is mapped to a row.
>> 
>>                {type: 'bar', seriesLayoutBy: 'row'},
>> 
>>                {type: 'bar', seriesLayoutBy: 'row'},
>> 
>>                {type: 'bar', seriesLayoutBy: 'row'},
>> 
>>                {type: 'bar', seriesLayoutBy: 'row'},
>> 
>>                {type: 'bar', seriesLayoutBy: 'row'},
>> 
>>                {type: 'bar', seriesLayoutBy: 'row'},
>> 
>>                {type: 'bar', seriesLayoutBy: 'row'},
>> 
>>                {type: 'bar', seriesLayoutBy: 'row'},
>> 
>>                {type: 'bar', seriesLayoutBy: 'row'},
>> 
>>                {type: 'bar', seriesLayoutBy: 'row'},
>> 
>>                {type: 'bar', seriesLayoutBy: 'row'},
>> 
>>                {type: 'bar', seriesLayoutBy: 'row'},
>> 
>>                {type: 'bar', seriesLayoutBy: 'row'},
>> 
>>            ]
>> 
>>        };
>> 
>> 
>> 
>> 
>> 
>> Thank you!
>> 
>> 
>> 
>> 
>> 
>> Best regards,
>> 
>> 
>> 
>> Tobias Svenberg
>> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@echarts.apache.org
For additional commands, e-mail: dev-help@echarts.apache.org


Re: Question regarding hiding bars in barchart

Posted by Ovilia <ov...@gmail.com>.
Hi Tobias.

This is a feature that ECharts does not support yet. Please follow
https://github.com/apache/incubator-echarts/issues/9899 for more
information.

Zhang Wenli
http://zhangwenli.com


Svenberg, Tobias <to...@sweco.se> 于2019年3月22日周五 上午12:31写道:

> Hello,
>
>
>
> I’ve tried to figure this one out but have hit a dead end. The option
> below creates a lot of empty space on the xAxis. This is, I assume the
> space taken by empty values. Is there a way to hide/skip these null bars?
>
>
>
>
>
>
>
> option = {
>
>             legend: {
>
>                 type: 'scroll',
>
>                 orient: 'vertical',
>
>                 right: 10,
>
>                 top: 20,
>
>                 bottom: 20,
>
>             },
>
>             tooltip: {
>
>                 trigger: 'axis',
>
>                 // showContent: false
>
>             },
>
>             dataset: {
>
>                 sourceHeader: true,
>
>                 source: [
>
>                     ['Tenant','Plan 01','Plan 02','Plan 03','Plan
> 04','Plan 05','Plan 06','Plan 07','Plan 08','Plan 09','Plan 10'],
>
>                     ['Real Estate
> Service',327.15,,null,null,null,null,null,null,null,null],
>
>                     ['Zeus
> Navigations',null,78.99,null,27.09,46.89,null,null,null,null,null],
>
>
> ['Vacant',null,42.29,null,69.39,null,null,null,83.69,26.71,null],
>
>                     ['Golden Road
> Corporation',null,33,null,null,null,null,null,null,null,null],
>
>                     ['Twister
> Foods',null,34.11,null,null,null,null,null,null,null,null],
>
>
> ['Melonetworks',null,null,69.39,null,null,null,null,null,27.08,null],
>
>
> ['Antarts',null,null,33.33,null,null,null,null,null,null,null],
>
>
> ['Spicurity',null,null,33.33,null,null,null,null,null,null,null],
>
>
> ['Surprisystems',null,null,null,null,52.29,46.89,null,null,null,null],
>
>
> ['Soulstones',null,null,null,null,null,52.29,null,null,null,null],
>
>
> ['Signalways',null,null,null,null,null,null,46.89,null,null,null],
>
>
> ['Shadowshade',null,null,null,null,null,null,52.29,null,null,null],
>
>                     ['Star
> Gazer',null,null,null,null,null,null,null,null,null,26.71]
>
>                 ],
>
>
>
>
>
>             },
>
>             xAxis: {type: 'category'},
>
>             yAxis:{},
>
>
>
>             series: [
>
>                 // // // These series is in the first cartesian (grid),
> and each
>
>                 // // // is mapped to a row.
>
>                 {type: 'bar', seriesLayoutBy: 'row'},
>
>                 {type: 'bar', seriesLayoutBy: 'row'},
>
>                 {type: 'bar', seriesLayoutBy: 'row'},
>
>                 {type: 'bar', seriesLayoutBy: 'row'},
>
>                 {type: 'bar', seriesLayoutBy: 'row'},
>
>                 {type: 'bar', seriesLayoutBy: 'row'},
>
>                 {type: 'bar', seriesLayoutBy: 'row'},
>
>                 {type: 'bar', seriesLayoutBy: 'row'},
>
>                 {type: 'bar', seriesLayoutBy: 'row'},
>
>                 {type: 'bar', seriesLayoutBy: 'row'},
>
>                 {type: 'bar', seriesLayoutBy: 'row'},
>
>                 {type: 'bar', seriesLayoutBy: 'row'},
>
>                 {type: 'bar', seriesLayoutBy: 'row'},
>
>             ]
>
>         };
>
>
>
>
>
> Thank you!
>
>
>
>
>
> Best regards,
>
>
>
> Tobias Svenberg
>

Re: Question regarding hiding bars in barchart

Posted by Ovilia <ov...@gmail.com>.
Hi Tobias.

This is a feature that ECharts does not support yet. Please follow
https://github.com/apache/incubator-echarts/issues/9899 for more
information.

Zhang Wenli
http://zhangwenli.com


Svenberg, Tobias <to...@sweco.se> 于2019年3月22日周五 上午12:31写道:

> Hello,
>
>
>
> I’ve tried to figure this one out but have hit a dead end. The option
> below creates a lot of empty space on the xAxis. This is, I assume the
> space taken by empty values. Is there a way to hide/skip these null bars?
>
>
>
>
>
>
>
> option = {
>
>             legend: {
>
>                 type: 'scroll',
>
>                 orient: 'vertical',
>
>                 right: 10,
>
>                 top: 20,
>
>                 bottom: 20,
>
>             },
>
>             tooltip: {
>
>                 trigger: 'axis',
>
>                 // showContent: false
>
>             },
>
>             dataset: {
>
>                 sourceHeader: true,
>
>                 source: [
>
>                     ['Tenant','Plan 01','Plan 02','Plan 03','Plan
> 04','Plan 05','Plan 06','Plan 07','Plan 08','Plan 09','Plan 10'],
>
>                     ['Real Estate
> Service',327.15,,null,null,null,null,null,null,null,null],
>
>                     ['Zeus
> Navigations',null,78.99,null,27.09,46.89,null,null,null,null,null],
>
>
> ['Vacant',null,42.29,null,69.39,null,null,null,83.69,26.71,null],
>
>                     ['Golden Road
> Corporation',null,33,null,null,null,null,null,null,null,null],
>
>                     ['Twister
> Foods',null,34.11,null,null,null,null,null,null,null,null],
>
>
> ['Melonetworks',null,null,69.39,null,null,null,null,null,27.08,null],
>
>
> ['Antarts',null,null,33.33,null,null,null,null,null,null,null],
>
>
> ['Spicurity',null,null,33.33,null,null,null,null,null,null,null],
>
>
> ['Surprisystems',null,null,null,null,52.29,46.89,null,null,null,null],
>
>
> ['Soulstones',null,null,null,null,null,52.29,null,null,null,null],
>
>
> ['Signalways',null,null,null,null,null,null,46.89,null,null,null],
>
>
> ['Shadowshade',null,null,null,null,null,null,52.29,null,null,null],
>
>                     ['Star
> Gazer',null,null,null,null,null,null,null,null,null,26.71]
>
>                 ],
>
>
>
>
>
>             },
>
>             xAxis: {type: 'category'},
>
>             yAxis:{},
>
>
>
>             series: [
>
>                 // // // These series is in the first cartesian (grid),
> and each
>
>                 // // // is mapped to a row.
>
>                 {type: 'bar', seriesLayoutBy: 'row'},
>
>                 {type: 'bar', seriesLayoutBy: 'row'},
>
>                 {type: 'bar', seriesLayoutBy: 'row'},
>
>                 {type: 'bar', seriesLayoutBy: 'row'},
>
>                 {type: 'bar', seriesLayoutBy: 'row'},
>
>                 {type: 'bar', seriesLayoutBy: 'row'},
>
>                 {type: 'bar', seriesLayoutBy: 'row'},
>
>                 {type: 'bar', seriesLayoutBy: 'row'},
>
>                 {type: 'bar', seriesLayoutBy: 'row'},
>
>                 {type: 'bar', seriesLayoutBy: 'row'},
>
>                 {type: 'bar', seriesLayoutBy: 'row'},
>
>                 {type: 'bar', seriesLayoutBy: 'row'},
>
>                 {type: 'bar', seriesLayoutBy: 'row'},
>
>             ]
>
>         };
>
>
>
>
>
> Thank you!
>
>
>
>
>
> Best regards,
>
>
>
> Tobias Svenberg
>