Nevron Forum
Back
Login
Register
Login
Register
Home
»
Nevron Open Vision for NET
»
NOV Chart for .NET
»
How to properly set font for x and y axis
How to properly set font for x and y axis
Post Reply
How
to
properly
set
font
for
x
and
y
axis
View
Flat Ascending
Flat Descending
Threaded
Options
Subscribe to topic
Print This Topic
Goto Topics Forum
Author
Message
Devin Ellis
Devin Ellis
posted 7 Years Ago
ANSWER
Topic Details
Group: Forum Members
Posts: 9,
Visits: 87
I
have
two
methods
used
on
my
charts
for
setting
the
fonts
Most
of
the
charts
use
&
nbsp
;
SetupChartAxes
and
some
use
&
nbsp
;
SetXAxisLabels
(
sorry
but
you
have
no
code
insert
&
nbsp
;
and
when
I
pasted
the
code
formatting
was
remove
).
The
&
nbsp
;
SetXAxisLabels
is
set
to
bold
and
the
chart
below
uses
that
but
the
labels
do
not
come
out
bold
.
Why
is
that
?
Images
Code
Snippet
public
&
nbsp
;
virtual
&
nbsp
;
void
&
nbsp
;
SetupChartAxes
&
nbsp
;(&
nbsp
;
NChart
&
nbsp
;
chart
&
nbsp
{&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
if
&
nbsp
;(&
nbsp
;
chart
&
nbsp
;==&
nbsp
;
null
&
nbsp
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
throw
&
nbsp
;
new
&
nbsp
;
ArgumentNullException
&
nbsp
;(&
nbsp
;"
chart
&
nbsp
;
required
"&
nbsp
; &
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
var
&
nbsp
;
scaleY
&
nbsp
;=&
nbsp
;
new
&
nbsp
;
NLinearScaleConfigurator
&
nbsp
;();&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
if
&
nbsp
;(&
nbsp
;
scaleY
&
nbsp
;==&
nbsp
;
null
&
nbsp
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
throw
&
nbsp
;
new
&
nbsp
;
NullReferenceException
&
nbsp
;(&
nbsp
;"
Failed
&
nbsp
;
to
&
nbsp
;
create
&
nbsp
;
y
&
nbsp
;
axis
"&
nbsp
; &
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
scaleY
.
MajorGridStyle
.
LineStyle
.
Pattern
&
nbsp
;=&
nbsp
;
LinePattern
.
Dash
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
scaleY
.
MajorGridStyle
.
ShowAtWalls
&
nbsp
;=&
nbsp
;
new
&
nbsp
;
ChartWallType
&
nbsp
;[]&
nbsp
;{&
nbsp
;
ChartWallType
.
Back
&
nbsp
;};&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
scaleY
.
InnerMajorTickStyle
.
Visible
&
nbsp
;=&
nbsp
;
false
; &
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
scaleY
.
LabelStyle
.
TextStyle
.
FontStyle
.
Style
&
nbsp
;=&
nbsp
;
FontStyle
.
Bold
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
scaleY
.
LabelStyle
.
TextStyle
.
FontStyle
.
EmSize
&
nbsp
;=&
nbsp
;
new
&
nbsp
;
NLength
&
nbsp
;(&
nbsp
;
DefaultFontSize
,&
nbsp
;
NGraphicsUnit
.
Point
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
scaleY
.
LabelStyle
.
TextStyle
.
FontStyle
.
Name
&
nbsp
;=&
nbsp
;
DefaultFontName
; &
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
chart
.
Axis
&
nbsp
;(&
nbsp
;
StandardAxis
.
PrimaryY
&
nbsp
.
ScaleConfigurator
&
nbsp
;=&
nbsp
;
scaleY
; &
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
var
&
nbsp
;
scaleX
&
nbsp
;=&
nbsp
;
new
&
nbsp
;
NLinearScaleConfigurator
&
nbsp
;();&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
if
&
nbsp
;(&
nbsp
;
scaleX
&
nbsp
;==&
nbsp
;
null
&
nbsp
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
throw
&
nbsp
;
new
&
nbsp
;
NullReferenceException
&
nbsp
;(&
nbsp
;"
Failed
&
nbsp
;
to
&
nbsp
;
create
&
nbsp
;
x
&
nbsp
;
axis
"&
nbsp
; &
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
scaleX
.
MajorGridStyle
.
LineStyle
.
Pattern
&
nbsp
;=&
nbsp
;
LinePattern
.
Dash
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
scaleX
.
MajorGridStyle
.
ShowAtWalls
&
nbsp
;=&
nbsp
;
new
&
nbsp
;
ChartWallType
&
nbsp
;[]&
nbsp
;{&
nbsp
;
ChartWallType
.
Back
&
nbsp
;};&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
scaleX
.
InnerMajorTickStyle
.
Visible
&
nbsp
;=&
nbsp
;
false
; &
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
scaleX
.
LabelStyle
.
TextStyle
.
FontStyle
.
Style
&
nbsp
;=&
nbsp
;
FontStyle
.
Bold
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
scaleX
.
LabelStyle
.
TextStyle
.
FontStyle
.
EmSize
&
nbsp
;=&
nbsp
;
new
&
nbsp
;
NLength
&
nbsp
;(&
nbsp
;
DefaultFontSize
,&
nbsp
;
NGraphicsUnit
.
Point
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
scaleX
.
LabelStyle
.
TextStyle
.
FontStyle
.
Name
&
nbsp
;=&
nbsp
;
DefaultFontName
; &
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
chart
.
Axis
&
nbsp
;(&
nbsp
;
StandardAxis
.
PrimaryX
&
nbsp
.
ScaleConfigurator
&
nbsp
;=&
nbsp
;
scaleX
;}
public
&
nbsp
;
virtual
&
nbsp
;
void
&
nbsp
;
SetXAxisLabels
&
nbsp
;(&
nbsp
;
NChart
&
nbsp
;
chart
&
nbsp
{&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
if
&
nbsp
;(&
nbsp
;
chart
&
nbsp
;==&
nbsp
;
null
&
nbsp
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
throw
&
nbsp
;
new
&
nbsp
;
ArgumentNullException
&
nbsp
;(&
nbsp
;"
chart
&
nbsp
;
required
"&
nbsp
; &
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;//&
nbsp
;
add
&
nbsp
;
scale
&
nbsp
;
to
&
nbsp
;
chart
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;//&
nbsp
;
hide
&
nbsp
;
axis
&
nbsp
;
ruler
,&
nbsp
;
ticks
&
nbsp
;
and
&
nbsp
;
automatic
&
nbsp
;
labels
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
var
&
nbsp
;
scaleX
&
nbsp
;=&
nbsp
;
new
&
nbsp
;
NDateTimeScaleConfigurator
&
nbsp
;();&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
if
&
nbsp
;(&
nbsp
;
scaleX
&
nbsp
;==&
nbsp
;
null
&
nbsp
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
throw
&
nbsp
;
new
&
nbsp
;
NullReferenceException
&
nbsp
;(&
nbsp
;"
Failed
&
nbsp
;
to
&
nbsp
;
create
&
nbsp
;
x
&
nbsp
;
axis
"&
nbsp
; &
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
chart
.
Axis
&
nbsp
;(&
nbsp
;
StandardAxis
.
PrimaryX
&
nbsp
.
ScaleConfigurator
&
nbsp
;=&
nbsp
;
scaleX
; &
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
scaleX
.
AutoLabels
&
nbsp
;=&
nbsp
;
false
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
scaleX
.
UseOrigin
&
nbsp
;=&
nbsp
;
false
; &
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
scaleX
.
RulerStyle
.
BorderStyle
.
Width
&
nbsp
;=&
nbsp
;
new
&
nbsp
;
NLength
&
nbsp
;(&
nbsp
;
1
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
scaleX
.
OuterMajorTickStyle
.
Length
&
nbsp
;=&
nbsp
;
new
&
nbsp
;
NLength
&
nbsp
;(&
nbsp
;
5
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
scaleX
.
InnerMajorTickStyle
.
Length
&
nbsp
;=&
nbsp
;
new
&
nbsp
;
NLength
&
nbsp
;(&
nbsp
;
0
&
nbsp
; &
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
scaleX
.
LabelStyle
.
TextStyle
.
FontStyle
.
Style
&
nbsp
;=&
nbsp
;
FontStyle
.
Bold
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
scaleX
.
LabelStyle
.
TextStyle
.
FontStyle
.
EmSize
&
nbsp
;=&
nbsp
;
new
&
nbsp
;
NLength
&
nbsp
;(&
nbsp
;
DefaultFontSize
,&
nbsp
;
NGraphicsUnit
.
Point
&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;&
nbsp
;
scaleX
.
LabelStyle
.
TextStyle
.
FontStyle
.
Name
&
nbsp
;=&
nbsp
;
DefaultFontName
; }
Reply
Like
0
GO
Merge Selected
Merge into selected topic...
Merge into merge target...
Merge into a specific topic ID...
Open Merge
Threaded View
Threaded View
How
to
properly
set
font
for
x
and
y
axis
Devin Ellis
-
7 Years Ago
Hi
Devin
,
Please
post
the
code
with
proper
formatting
its
hard
to
tell
...
Nevron Support
-
7 Years Ago
I
had
this
in
my
original
message
: (
sorry
but
you
have
no
code
...
Devin Ellis
-
7 Years Ago
I
have
verified
that
the
font
style
is
not
changed
after
the
series
...
Devin Ellis
-
7 Years Ago
Hi
Devin
.
The
code
that
modifies
the
font
style
to
bold
looks
ok
...
Nevron Support
-
7 Years Ago
Hi
Devin
,
Please
post
sensitive
code
to
support
@
nevron
.
com
.
We
are
...
Nevron Support
-
7 Years Ago
Post Reply
Similar Topics
Post Quoted Reply
Reading This Topic
Login
Login
Remember Me
Reset Password
Resend Validation Email
Login
Explore
Messages
Mentions
Search