2015-06-29 51 views
0

請建議如何在鼠標懸停的telerik radhtmlchart.AS上顯示手形符號,現在我只能在鼠標懸停上獲取指針符號。radhtmlchart columnseries圖表光標手符號更改

<telerik:radhtmlchart runat="server" id="RadHtmlChartfirst" onclientseriesclicked="OnClientSeriesClickedfirst" 
        legend-appearance-position="Top" legend-appearance-visible="true" plotarea-xaxis-minorgridlines-visible="false" 
        plotarea-yaxis-minorgridlines-visible="false" plotarea-xaxis-majorgridlines-visible="false" 
        plotarea-yaxis-majorgridlines-visible="false" height="444" width="900"> 
        <PlotArea> 
         <Series> 
          <telerik:ColumnSeries DataFieldY="myValues1" Name="Name1"> 
          </telerik:ColumnSeries> 
          <telerik:ColumnSeries DataFieldY="myValues2" Name="Name2"> 
          </telerik:ColumnSeries> 
          <telerik:ColumnSeries DataFieldY="myValues3" Name="Name3"> 
          </telerik:ColumnSeries> 
         </Series> 
         <XAxis DataLabelsField="myLabels"> 
         </XAxis> 
        </PlotArea> 
        <Legend> 
         <Appearance Visible="true" Position="Bottom" /> 
        </Legend> 
        <Appearance> 
         <FillStyle BackgroundColor="" /> 
        </Appearance> 
        <ChartTitle Text="Reviewer Utilization Report"> 
        </ChartTitle> 
       </telerik:radhtmlchart> 

回答

0

沒有內置設施,因爲此圖表呈現SVG,而且遊標樣式通常適用於HTML元素。我嘗試以下站不住腳的鼠標事件處理,它似乎樣的工作,但:

 <telerik:RadHtmlChart runat="server" ID="chart" onmouseout="onmouseoutHandler();"> 
      <ClientEvents OnSeriesHover="OnSeriesHover" /> 
      <PlotArea> 
       <Series> 
        <telerik:ColumnSeries Name="first"> 
         <SeriesItems> 
          <telerik:CategorySeriesItem Y="1" /> 
          <telerik:CategorySeriesItem Y="2" /> 
          <telerik:CategorySeriesItem Y="3" /> 
         </SeriesItems> 
        </telerik:ColumnSeries> 
        <telerik:ColumnSeries Name="second"> 
         <SeriesItems> 
          <telerik:CategorySeriesItem Y="1" /> 
          <telerik:CategorySeriesItem Y="2" /> 
          <telerik:CategorySeriesItem Y="3" /> 
         </SeriesItems> 
        </telerik:ColumnSeries> 
       </Series> 
      </PlotArea> 
     </telerik:RadHtmlChart> 
     <script> 
      function OnSeriesHover(e) { 
       document.onmouseover = null; 
       if (e.series.name == "first") { //consider adding some conditions or removing them at all 
        e.preventDefault(); 
        setTimeout(function() { 
         document.body.style.cursor = "pointer" 
        }, 50); 
       } 
       return false; 
      } 

      //attached to onmouseout of the chart wrapper to restore the cursor 
      //as soon as the mouse moves on the chart 
      function onmouseoutHandler(e) { 
       document.body.onmouseover = restoreCursor; 
      } 
      //the handler that restores the cursor for the page 
      function restoreCursor() { 
       document.body.style.cursor = ""; 
      } 
      //resets the cursor 
      document.body.onmouseover = restoreCursor; 
     </script> 

,我不得不添加此CSS,以確保我的身體元素足夠大:

 html, body, form 
     { 
      height: 100%; 
      margin: 0; 
      padding: 0; 
     } 
+0

是的onmouseout一個內置事件?我沒有得到那個財產... –

+0

它不適合我......請幫助我解決這個問題,因爲客戶端需要手形符號,因爲它是一種向下鑽取圖表。 –

+0

什麼是您的Telerik版本?我用最新的。大概一年前,圖表的事件發生了一些變化。升級或查看類似的可用屬性。 OnClientSeriesHovered的聲音可能是舊名稱 – rdmptn