2017-09-19 1 views
0

私は韓国語です。英語をよく話さないでください。 私は現在の問題を解決したい。時間を表す 。ただし、この時間は9時間ごとに異なります。 私はこの問題を解決したい。どうか教えてください。 はまさに韓国のタイムゾーンのように聞こえる、KST(UTC +9)、vaadin-チャートやその...Vaadinのチャート日時が異なります

enter image description here

enter image description here

<dom-module id="queue-area-charts"> 
 
    <template> 
 
     <iron-ajax auto id="AjaxPost" url="http://localhost:9090/ybTest2" method="POST" content-type="application/json" handle-as="json" on-response="_onResponse" last-response="{{hresponse}}" debounce-duration="300"></iron-ajax> 
 
     <template is="dom-repeat" items="{{hresponse}}" as="hresponse"> 
 
      {{hresponse.cpu}} 
 
      {{hresponse.AGENT_TIME}} 
 
      <p></p> 
 
     </template> 
 

 
     <vaadin-area-chart id="chart"> 
 
      <x-axis type="datetime"></x-axis> 
 
      <y-axis allow-decimals='false' min='0' max="100"> 
 
      </y-axis> 
 
            <!--"2017-07-27 18:04:46" 15 ==== 1501146197000--> 
 
      <tooltip formatter="function() { 
 
        return '<b>'+Highcharts.dateFormat('%Y-%m-%d %H:%M:%S', this.x) + '<br/>';}"> 
 
      </tooltip> 
 
      <data-series name="Queue"> 
 
       <data> 
 
        <template is="dom-repeat" items="{{hresponse}}" as="hresponse"> 
 
         <point> 
 
          <x>[[hresponse.AGENT_TIME]]</x> 
 
          <y>[[hresponse.cpu]]</y> 
 
         </point> 
 
        </template> 
 
       </data> 
 
      </data-series> 
 
     </vaadin-area-chart> 
 
    </template> 
 
    <script> 
 
     Polymer({ 
 
      is: "queue-area-charts", 
 
      properties: { 
 
       hresponse:{ 
 
        type: Object, 
 
        notify:true, 
 
       }, 
 
      }, 
 
      _onResponse: function(e, request) { 
 
       this.attached(); 
 
      }, 
 
      attached: function() { 
 
       this.async(function() { 
 
        var starttime = "2017-07-27 18:04:46", 
 
         endtime = "2017-07-28 00:00:00"; 
 
        var oData = {"starttime": starttime, "endtime": endtime}; 
 
        this.$.AjaxPost.body = JSON.stringify(oData); 
 
        this.$.AjaxPost.generateRequest(); 
 
       }, 3000); 
 
      } 
 
     }); 
 
    </script> 
 
</dom-module>

+0

ybTest2のコードを投稿してください。どのようにデータベースに投稿していますか?同上//プライマリキー @GeneratedValue(戦略= GenerationType.AUTO)//자동증가 @Column(名前は= "SEQ_NO") 公共長いSEQNO @ – Ofisora

+0

//エンティティ 。 @DateTimeFormat(パターン= "yyyy-MM-dd HH:mm:ss") @Column(name = "INPUT_TIME") @Temporal(TemporalType.TIMESTAMP) public Date inputTime; @DateTimeFormat(パターン= "YYYY-MM-DD HH:MM:SS") @Column(名前= "AGENT_TIME") @Temporal(TemporalType.TIMESTAMP) @NotNull –

+0

@Ofisora // @ ResponseBody 公衆リスト ybTest2(@RequestBody Map <オブジェクト、オブジェクト>マップ、モデルモデル、日付開始時刻、終了時刻)throwException IOException、ParseException { String testtime = map.get( "starttime")。toString(); 文字列testtime1 = map.get( "endtime")。toString(); // testtime = 2017-07-27 18:04:46 SimpleDateFormat transFormat = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss"); –

答えて

0

9時間をいただきありがとうございます基礎となるチャートライブラリには、デフォルトでUTCの日付が表示されます。

だから、次のことができます。

  • いずれかのシリーズ
  • またはグラフが描画される前に、次のコードを実行して、UTCの使用を無効にUTCの日付を設定します。

Highcharts.setOptions({ global: { useUTC: false } });

+0

ご協力いただきありがとうございます。 –

関連する問題