Example #1
0
            public void FormatAsFractionsPiHalf()
            {
                var axis = new LinearAxis
                {
                    FormatAsFractions  = true,
                    FractionUnit       = Math.PI,
                    FractionUnitSymbol = "π"
                };

                Assert.AreEqual("π/2", axis.FormatValue(0.5 * Math.PI));
            }
Example #2
0
            public void FormatAsFractionsZero()
            {
                var axis = new LinearAxis
                {
                    FormatAsFractions  = true,
                    FractionUnit       = Math.PI,
                    FractionUnitSymbol = "π"
                };

                Assert.AreEqual("0", axis.FormatValue(0));
            }
Example #3
0
            public void FormatAsFractionsThreeHalfPi()
            {
                var axis = new LinearAxis
                {
                    FormatAsFractions  = true,
                    FractionUnit       = Math.PI,
                    FractionUnitSymbol = "π"
                };

                Assert.AreEqual("3π/2", axis.FormatValue(3d / 2 * Math.PI));
            }
Example #4
0
            public void FormatAsFractionsTwoPi()
            {
                var axis = new LinearAxis
                {
                    FormatAsFractions  = true,
                    FractionUnit       = Math.PI,
                    FractionUnitSymbol = "π"
                };

                Assert.AreEqual("2π", axis.FormatValue(2 * Math.PI));
            }
Example #5
0
            public void FormatAsFractionsWithStringFormat()
            {
                var model = new PlotModel {
                    Culture = CultureInfo.InvariantCulture
                };
                var axis = new LinearAxis
                {
                    FormatAsFractions  = true,
                    FractionUnit       = Math.PI,
                    FractionUnitSymbol = "π",
                    StringFormat       = "0.###"
                };

                model.Axes.Add(axis);
                ((IPlotModel)model).Update(true);
                Assert.AreEqual("1.273π", axis.FormatValue(4));
            }