2012-04-16 5 views
1

私のWPFプロジェクトでTeeChart(http://www.teechart.net/)ScrollPagerツールを使用したいが、動作しません。 (TeeChart.WPF.dllバージョン4.1.2012.2287)が正常に動作のWinFormsプロジェクトで
TeeChart ScrollPagerツールがWPFプロジェクトで動作しない

http://img190.imageshack.us/img190/4900/scrwpf.png

namespace TeeChart 
{ 
    using Steema.TeeChart.WPF.Themes; 
    using Steema.TeeChart.WPF.Tools; 
    using Steema.TeeChart.WPF.Styles; 
    using Steema.TeeChart.WPF.Drawing; 

    public partial class MainWindow 
    { 
     private Line _series; 
     private ScrollPager _tool; 
     BlackIsBackTheme _black; 

     public MainWindow() 
     { 
      InitializeComponent(); 

      _series = new Line(); 
      tChart1.Series.Add(_series); 
      tChart1.Chart.Aspect.View3D = false; 
      tChart1.Header.Visible = false; 
      tChart1.Legend.Visible = false; 

      _series.FillSampleValues(500); 

      _black = new BlackIsBackTheme(tChart1.Chart); 
      _black.Apply(); 


      _tool = new ScrollPager(); 
      tChart1.Tools.Add(_tool); 

      _tool.Series = _series; 
      _black = new BlackIsBackTheme(_tool.SubChartTChart.Chart); 
      _black.Apply(); 

      _tool.SubChartTChart.Panel.Pen.Visible = false; 
      _tool.SubChartTChart.Panel.Bevel.Inner = BevelStyles.None; 
      _tool.SubChartTChart.Panel.Bevel.Outer = BevelStyles.None; 
     } 
    } 
} 



が。
http://img692.imageshack.us/img692/4527/scrwinforms.png

namespace TeeChartWinForms 
{ 
    using System.Windows.Forms; 
    using Steema.TeeChart.Drawing; 
    using Steema.TeeChart.Styles; 
    using Steema.TeeChart.Themes; 
    using Steema.TeeChart.Tools; 

    public partial class Form1 : Form 
    { 
     private Line _series; 
     private ScrollPager _tool; 
     BlackIsBackTheme _black; 


     public Form1() 
     { 
      InitializeComponent(); 

      _series = new Line(); 
      tChart1.Series.Add(_series); 
      tChart1.Chart.Aspect.View3D = false; 
      tChart1.Header.Visible = false; 
      tChart1.Legend.Visible = false; 

      _series.FillSampleValues(500); 

      _black = new BlackIsBackTheme(tChart1.Chart); 
      _black.Apply(); 


      _tool = new ScrollPager(); 
      tChart1.Tools.Add(_tool); 

      _tool.Series = _series; 
      _black = new BlackIsBackTheme(_tool.SubChartTChart.Chart); 
      _black.Apply(); 

      _tool.SubChartTChart.Panel.Pen.Visible = false; 
      _tool.SubChartTChart.Panel.Bevel.Inner = BevelStyles.None; 
      _tool.SubChartTChart.Panel.Bevel.Outer = BevelStyles.None; 
     } 
    } 
} 



おかげで、
アレックス

答えて

2

あなたの問題は、次のコードを使用して表示されないようだ:

コードC#:

using System; 
    using System.Collections.Generic; 
    using System.Linq; 
    using System.Text; 
    using System.Windows; 
    using System.Windows.Controls; 
    using System.Windows.Data; 
    using System.Windows.Documents; 
    using System.Windows.Input; 
    using System.Windows.Media; 
    using System.Windows.Media.Imaging; 
    using System.Windows.Navigation; 
    using System.Windows.Shapes; 
    using Steema.TeeChart.WPF; 
    using Steema.TeeChart.WPF.Styles; 
    using System.IO; 
    using System.Windows.Markup; 
    using Steema.TeeChart.WPF.Tools; 
    using Steema.TeeChart.WPF.Drawing; 
    using Steema.TeeChart.WPF.Themes; 
    namespace WpfApplication1 
    { 
     public partial class MainWindow : Window 
     { 
      private Steema.TeeChart.WPF.Styles.Line series; 
      private ScrollPager tool; 
      BlackIsBackTheme black; 

      public MainWindow() 
      { 
       InitializeComponent(); 

       series = new Steema.TeeChart.WPF.Styles.Line(); 
       tChart1.Series.Add(series); 
       tChart1.Chart.Aspect.View3D = false; 
       tChart1.Header.Visible = false; 
       tChart1.Legend.Visible = false; 

       series.FillSampleValues(500); 

       black = new BlackIsBackTheme(tChart1.Chart); 
       black.Apply(); 


       tool = new ScrollPager(tChart1.Chart); 

       tool.Series = series; 
       black = new BlackIsBackTheme(tool.SubChartTChart.Chart); 
       black.Apply(); 

       tool.SubChartTChart.Panel.Pen.Visible = false; 
       tool.SubChartTChart.Panel.Bevel.Inner = BevelStyles.None; 
       tool.SubChartTChart.Panel.Bevel.Outer = BevelStyles.None; 
      } 
} 
} 

コードXAML:

<Window x:Class="WpfApplication1.MainWindow" 
     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
     xmlns:tc="clr-namespace:Steema.TeeChart.WPF;assembly=TeeChart.WPF" 
     Title="MainWindow" SizeToContent="WidthAndHeight" mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" d:DesignHeight="516" d:DesignWidth="492"> 
    <Grid > 
     <AdornerDecorator Margin="25,12,27,65"> 
      <tc:TChart Name="tChart1" Height="226" Width="412" /> 
     </AdornerDecorator> 

    </Grid> 

</Window> 

そして私は、WinFormsのと同じ結果を得ることができます。私のコードを使用している場合は、問題が解決されたか、まだ表示されている場合は、もう一度お試しください。問題が解決しない場合は、ここで問題を再現するために「そのまま」実行できる簡単なサンプルプロジェクトをsteema.net/uploadに送ってください。

おかげで、

敬具

サンドラ

+0

サンドラは、あなたのコードは、魔法のように動作します!あなたは私の一日を救った。 残念ながら、範囲外にスクロールしている間にもう1つのバグがあります(アプリケーションがハングする)ので、まだ使用できません) すべてベスト、 アレックス – ingeniero

関連する問題