删除Android的HighCharts边框

问题描述:

我想加载一个android webview中的高图表js,它工作正常!删除Android的HighCharts边框

我的webview是在LinearLayout中,我希望两个布局的背景都是相同的颜色。但是我的图表周围存在一个不可取的白色边框,我无法移除。

我已经在js文件中设置了图表背景颜色,并在xml文件中设置了linearlayout背景颜色。 我试着为webview设置一个橙色背景颜色,但我看不到它。 我也尝试更改图表的bordercolor和边界大小属性,但问题保持不变。 我不知道现在该做什么....

我的布局是这样的:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:tools="http://schemas.android.com/tools" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:orientation="vertical" 
android:paddingBottom="@dimen/activity_vertical_margin" 
android:paddingLeft="@dimen/activity_horizontal_margin" 
android:paddingRight="@dimen/activity_horizontal_margin" 
android:paddingTop="@dimen/activity_vertical_margin" 
android:background="#d6d7d4" 
tools:context=".MainActivity" > 

<WebView 
    android:id="@+id/chartView" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:background="@android:color/holo_orange_dark"/> 

<ListView 
    android:id="@+id/alarmList" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content"/> 

我的JS是这样的:

$(document).ready(function() { 
var chart1 = new Highcharts.Chart({ 
    chart: { 
     renderTo: 'container', 
     backgroundColor: '#d6d7d4', 

     zoomType: 'x' 
    }, 
    xAxis: { 
     type: 'datetime', 
     dateTimeLabelFormats: { 
      year: '%Y' 
     } 
    }, 
    yAxis: { 
     title: { 
      text: 'MW' 
     }, 
     max: 500, 
     plotBands: [{ 
      from: 0, 
      to: 100, 
      color: 'rgba(247, 247, 247, 0.3)' 
     }, { 
      from: 100, 
      to: 200, 
      color: 'rgba(215, 216, 212, 0.3)' 
     }, { // Light breeze 
      from: 200, 
      to: 300, 
      color: 'rgba(247, 247, 247, 0.3)' 
     }, { // Light breeze 
      from: 300, 
      to: 400, 
      color: 'rgba(215, 216, 212, 0.3)' 
     },{ 
      from: 400, 
      to: 500, 
      color: 'rgba(247, 247, 247, 0.3)' 
     }] 
    }, 
    title: { 
     text: '' 
    }, 
    subtitle: { 
     text: '' 
    }, 
    tooltip: { 
     formatter: function() { 
      return '<b>'+ this.series.name +'</b><br/>'+ 
      Highcharts.dateFormat('%Y', this.x) +': '+ this.y +' %'; 
     }, 
     valueDecimals: 1, 
     valueSuffix: ' %' 
    }, 
    series: 
    [{ 
     data: [[Date.UTC(2005, 1, 1),0], 
      [Date.UTC(2008, 1, 1),10], 
      [Date.UTC(2008, 1, 1),20], 
      [Date.UTC(2010, 10, 1),30], 
      [Date.UTC(2010, 10, 1),40], 
      [Date.UTC(2013, 7, 1),50], 
      [Date.UTC(2013, 7, 1),80]], 
     type: 'line', 
     color: "#504AA9" 
    }] 
}); 

}) ;

而且我的Android屏幕的截屏:

enter image description here

设置网页的背景可能摆脱它。

http://jsfiddle.net/48wEc/

<body style="background-color:#d6d7d4;"> </body> 

如果没有,那么它一定是你的WebView使得该房客一些如何。

+0

就是这样!谢谢瑞恩 –