簡體   English   中英

如何刪除移動應用中的額外空間?

[英]How can i remove extra space in mobile app?

在此輸入圖像描述

我正在使用Highchart框架開發移動應用程序,我使用Highchart,HTML和CSS創建了一個應用程序。 我已從上面的應用上傳了屏幕截圖。

我想刪除圖表和表格之間的空格。

這是圖表的代碼:

$(function () {
  $('#statement-graph').highcharts({
    chart: {
      plotBackgroundColor: null,
      plotBorderWidth: 0,
      plotShadow: true,
      backgroundColor: 'transparent',
      borderWidth: 0
    },
    title: {
      text: 'Expense',
      align: 'center',
      verticalAlign: 'middle',
      font: 'gothamrnd-light',
      y: -10,
      x : 1,
      style : {
        color: '#fff',
        fontSize: '0.9em'
      },
    },
    header :{

    },
    credits: {
      enabled: false
    },
    subtitle: {
      text: 'Rs 25000',
      align: 'center',
      verticalAlign: 'middle',
      y: 10,
      x : 1,
      style : {
        color: '#fff',
        fontSize: '1.2em'
      },
    },
    exporting: { enabled: false },
    tooltip: {
      pointFormat: '<b>{point.percentage:.1f}%</b>'
    },
    plotOptions: {
      series: {
        dataLabels: {
          enabled: true,
          format: '<b>{point.name}</b>',
          style: {
            color: 'white',
            textShadow: '0px 0px 0px white',
            fontWeight: '200',
            font: '13px gothamrnd-light'
          },
          connectorColor: 'white',
        }
      },
      pie: {
        dataLabels: {
          enabled: false
        },
        shadow: true,
        center: ['50%', '50%'],
        borderWidth: 0 // < set this option
      }
    },

    series: [{
      type: 'pie',
      name: '',
      innerSize: '50%',
      showInLegend: false,
      data: [
        {
          name: 'Utilities',
          y: 45, 
          color : "#D2C993"
        },
        {
          name: 'Clothing',
          y: 30,
          color : "#CD7D80"
        },
        {
          name: 'Entertainment',
          y: 15,
          color : "#B486B1"
        },
        {
          name: 'Medical',
          y: 12,
          color : "#5CB1CE"
        },
        {
          name: 'Vacations',
          y: 23,
          color : "#F2C56A"
        },
        {
          name: 'Food & Drinks',
          y: 30,
          color : "#F78E58"
        }
      ]
    }]
  });
});

以下是Highchart的HTML:

<div id="statement-graph" style="
    height: 60vh;
    margin: 0px auto;
    width: 100%;
    float: left;
    text-align: center;
    display: table;"></div>

最好是查看生成的頁面源代碼,這樣我就可以識別元素的單獨ID或類,但這里有一個建議。 在您的圖表代碼中:

  pie: {
    dataLabels: {
      enabled: false
    },
    shadow: true,
    center: ['50%', '50%'],
    borderWidth: 0 // < set this option
  }

嘗試改變

中心:['50%','50%'],到

中心:['50%','25%']或

中心:['50%','75%'],

......你在哪里:

subtitle: {
  text: 'Rs 25000',
  align: 'center',
  verticalAlign: 'middle',
  y: 10,
  x : 1,
  style : {
    color: '#fff',
    fontSize: '1.2em'
  },
},

你可以嘗試改變

  verticalAlign: 'middle',

to verticalAlign:'bottom',

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM