Module: Tk::Tcllib::Plotchart::ChartMethod

Includes:
TkCore
Included in:
Barchart, Barchart3D, Boxplot, Ganttchart, IsometricPlot, Piechart, Plot3D, PolarPlot, Radialchart, RibbonChart3D, RightAxis, Timechart, XYPlot
Defined in:
lib/tkextlib/tcllib/plotchart.rb

Constant Summary

Constants included from TkCore

TkCore::EventFlag, TkCore::INTERP, TkCore::INTERP_MUTEX, TkCore::INTERP_ROOT_CHECK, TkCore::INTERP_THREAD, TkCore::INTERP_THREAD_STATUS, TkCore::RUN_EVENTLOOP_ON_MAIN_THREAD, TkCore::WIDGET_DESTROY_HOOK, TkCore::WITH_ENCODING, TkCore::WITH_RUBY_VM

Constants included from TkComm

TkComm::GET_CONFIGINFO_AS_ARRAY, TkComm::GET_CONFIGINFOwoRES_AS_ARRAY, TkComm::TkExtlibAutoloadModule, TkComm::Tk_CMDTBL, TkComm::Tk_IDs, TkComm::Tk_WINDOWS, TkComm::USE_TCLs_LIST_FUNCTIONS, TkComm::WidgetClassNames

Constants included from TkUtil

TkUtil::None, TkUtil::RELEASE_DATE

Instance Method Summary collapse

Methods included from TkCore

#_tk_call_to_list_core, #after, #after_cancel, #after_idle, #appname, #appsend, #appsend_deny, #appsend_displayof, callback, #callback_break, #callback_continue, #callback_return, #chooseColor, #chooseDirectory, #do_one_event, #event_generate, #getMultipleOpenFile, #getMultipleSaveFile, #getOpenFile, #getSaveFile, #get_eventloop_tick, #get_eventloop_weight, #get_no_event_wait, #inactive, #inactive_displayof, #info, #ip_eval, #ip_eval_with_enc, #ip_eval_without_enc, #ip_invoke, #ip_invoke_with_enc, #ip_invoke_without_enc, #is_mainloop?, #load_cmd_on_ip, #mainloop, #mainloop_exist?, #mainloop_thread?, #mainloop_watchdog, #messageBox, #rb_appsend, #rb_appsend_displayof, #reset_inactive, #reset_inactive_displayof, #restart, #scaling, #scaling_displayof, #set_eventloop_tick, #set_eventloop_weight, #set_no_event_wait, #tk_call, #tk_call_to_list, #tk_call_to_list_with_enc, #tk_call_to_list_without_enc, #tk_call_to_simplelist, #tk_call_to_simplelist_with_enc, #tk_call_to_simplelist_without_enc, #tk_call_with_enc, #tk_call_without_enc, #windowingsystem

Methods included from TkComm

_at, _callback_entry?, _callback_entry_class?, _curr_cmd_id, _fromUTF8, _genobj_for_tkwidget, _next_cmd_id, _toUTF8, array2tk_list, #bind, #bind_all, #bind_append, #bind_append_all, #bind_remove, #bind_remove_all, #bindinfo, #bindinfo_all, bool, image_obj, #install_cmd, install_cmd, list, num_or_nil, num_or_str, number, procedure, simplelist, slice_ary, string, #subst, tk_tcl2ruby, uninstall_cmd, #uninstall_cmd, window

Methods included from TkEvent

#install_bind, #install_bind_for_event_class

Methods included from TkUtil

#_conv_args, _conv_args, #_fromUTF8, #_get_eval_enc_str, _get_eval_enc_str, #_get_eval_string, _get_eval_string, _symbolkey2str, #_symbolkey2str, #_toUTF8, #bool, bool, callback, eval_cmd, #hash_kv, hash_kv, install_cmd, #num_or_nil, num_or_nil, num_or_str, #num_or_str, number, #number, string, #string, uninstall_cmd, untrust

Instance Method Details

#background(part, color_or_image, dir) ⇒ Object



198
199
200
201
202
# File 'lib/tkextlib/tcllib/plotchart.rb', line 198

def background(part, color_or_image, dir)
  tk_call_without_enc(@chart, 'background',
                      part, color_or_image, dir)
  self
end

#balloon(*args) ⇒ Object

args => (x, y, text, dir) or ([x, y], text, dir)



229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
# File 'lib/tkextlib/tcllib/plotchart.rb', line 229

def balloon(*args) # args => (x, y, text, dir) or ([x, y], text, dir)
  if args[0].kind_of?(Array)
    # args => ([x, y], text, dir)
    x, y = args.shift
  else
    # args => (x, y, text, dir)
    x = args.shift
    y = args.shift
  end

  text, dir = args

  tk_call_without_enc(@chart, 'balloon', x, y,
                      _get_eval_enc_str(text), dir)
  self
end

#balloonconfig(key, value = None) ⇒ Object



246
247
248
249
250
251
252
# File 'lib/tkextlib/tcllib/plotchart.rb', line 246

def balloonconfig(key, value=None)
  if key.kind_of?(Hash)
    tk_call_without_enc(@chart, 'balloonconfig', *hash_kv(key, true))
  else
    tk_call(@chart, 'balloonconfig', "-#{key}", value)
  end
end

#coords_3D_to_pixel(x, y, z) ⇒ Object



295
296
297
# File 'lib/tkextlib/tcllib/plotchart.rb', line 295

def coords_3D_to_pixel(x, y, z)
  list(tk_call_without_enc('::Plotchart::coords3DToPixel', @path, x, y, z))
end

#coords_to_pixel(x, y) ⇒ Object



291
292
293
# File 'lib/tkextlib/tcllib/plotchart.rb', line 291

def coords_to_pixel(x, y)
  list(tk_call_without_enc('::Plotchart::coordsToPixel', @path, x, y))
end

#determine_scale(xmax, ymax) ⇒ Object



317
318
319
320
# File 'lib/tkextlib/tcllib/plotchart.rb', line 317

def determine_scale(xmax, ymax)
  tk_call_without_enc('::Plotchart::determineScale', @path, xmax, ymax)
  self
end

#legend(series, text) ⇒ Object



223
224
225
226
227
# File 'lib/tkextlib/tcllib/plotchart.rb', line 223

def legend(series, text)
  tk_call_without_enc(@chart, 'legend',
                      _get_eval_enc_str(series), _get_eval_enc_str(text))
  self
end

#legendconfig(key, value = None) ⇒ Object



214
215
216
217
218
219
220
221
# File 'lib/tkextlib/tcllib/plotchart.rb', line 214

def legendconfig(key, value=None)
  if key.kind_of?(Hash)
    tk_call_without_enc(@chart, 'legendconfig', *hash_kv(key, true))
  else
    tk_call(@chart, 'legendconfig', "-#{key}", value)
  end
  self
end

#pixel_to_coords(x, y) ⇒ Object



313
314
315
# File 'lib/tkextlib/tcllib/plotchart.rb', line 313

def pixel_to_coords(x, y)
  list(tk_call_without_enc('::Plotchart::pixelToCoords', @path, x, y))
end

#plaintext(*args) ⇒ Object

args => (x, y, text, dir) or ([x, y], text, dir)



254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
# File 'lib/tkextlib/tcllib/plotchart.rb', line 254

def plaintext(*args) # args => (x, y, text, dir) or ([x, y], text, dir)
  if args[0].kind_of?(Array)
    # args => ([x, y], text, dir)
    x, y = args.shift
  else
    # args => (x, y, text, dir)
    x = args.shift
    y = args.shift
  end

  text, dir = args

  tk_call_without_enc(@chart, 'plaintext', x, y,
                      _get_eval_enc_str(text), dir)
  self
end

#plotpack(dir, *plots) ⇒ Object



299
300
301
302
# File 'lib/tkextlib/tcllib/plotchart.rb', line 299

def plotpack(dir, *plots)
  tk_call_without_enc('::Plotchart::plotpack', @path, dir, *plots)
  self
end

#polar_coordinates(radmax) ⇒ Object



304
305
306
307
# File 'lib/tkextlib/tcllib/plotchart.rb', line 304

def polar_coordinates(radmax)
  tk_call_without_enc('::Plotchart::polarCoordinates', @path, radmax)
  self
end

#polar_to_pixel(rad, phi) ⇒ Object



309
310
311
# File 'lib/tkextlib/tcllib/plotchart.rb', line 309

def polar_to_pixel(rad, phi)
  list(tk_call_without_enc('::Plotchart::polarToPixel', @path, rad, phi))
end

#save_plot(filename) ⇒ Object



165
166
167
168
# File 'lib/tkextlib/tcllib/plotchart.rb', line 165

def save_plot(filename)
  tk_call_without_enc(@chart, 'saveplot', filename)
  self
end

#set_zoom_panObject



322
323
324
325
# File 'lib/tkextlib/tcllib/plotchart.rb', line 322

def set_zoom_pan()
  tk_call_without_enc('::Plotchart::setZoomPan', @path)
  self
end

#title(str) ⇒ Object



160
161
162
163
# File 'lib/tkextlib/tcllib/plotchart.rb', line 160

def title(str)
  tk_call_without_enc(@chart, 'title', _get_eval_enc_str(str))
  self
end

#view_port(*args) ⇒ Object

args := pxmin, pymin, pxmax, pymax



273
274
275
276
# File 'lib/tkextlib/tcllib/plotchart.rb', line 273

def view_port(*args) # args := pxmin, pymin, pxmax, pymax
  tk_call_without_enc('::Plotchart::viewPort', @path, *(args.flatten))
  self
end

#world_3D_coordinates(*args) ⇒ Object



284
285
286
287
288
289
# File 'lib/tkextlib/tcllib/plotchart.rb', line 284

def world_3D_coordinates(*args)
  # args := xmin, ymin, zmin, xmax, ymax, zmax
  tk_call_without_enc('::Plotchart::world3DCoordinates',
                      @path, *(args.flatten))
  self
end

#world_coordinates(*args) ⇒ Object

args := xmin, ymin, xmax, ymax



278
279
280
281
282
# File 'lib/tkextlib/tcllib/plotchart.rb', line 278

def world_coordinates(*args) # args := xmin, ymin, xmax, ymax
  tk_call_without_enc('::Plotchart::worldCoordinates',
                      @path, *(args.flatten))
  self
end

#xconfig(key, value = None) ⇒ Object



180
181
182
183
184
185
186
187
# File 'lib/tkextlib/tcllib/plotchart.rb', line 180

def xconfig(key, value=None)
  if key.kind_of?(Hash)
    tk_call_without_enc(@chart, 'xconfig', *hash_kv(key, true))
  else
    tk_call(@chart, 'xconfig', "-#{key}",value)
  end
  self
end

#xtext(str) ⇒ Object



170
171
172
173
# File 'lib/tkextlib/tcllib/plotchart.rb', line 170

def xtext(str)
  tk_call_without_enc(@chart, 'xtext', _get_eval_enc_str(str))
  self
end

#xticklines(color = None) ⇒ Object



204
205
206
207
# File 'lib/tkextlib/tcllib/plotchart.rb', line 204

def xticklines(color=None)
  tk_call(@chart, 'xticklines', color)
  self
end

#yconfig(key, value = None) ⇒ Object



189
190
191
192
193
194
195
196
# File 'lib/tkextlib/tcllib/plotchart.rb', line 189

def yconfig(key, value=None)
  if key.kind_of?(Hash)
    tk_call_without_enc(@chart, 'yconfig', *hash_kv(key, true))
  else
    tk_call(@chart, 'yconfig', "-#{key}", value)
  end
  self
end

#ytext(str) ⇒ Object



175
176
177
178
# File 'lib/tkextlib/tcllib/plotchart.rb', line 175

def ytext(str)
  tk_call_without_enc(@chart, 'ytext', _get_eval_enc_str(str))
  self
end

#yticklines(color = None) ⇒ Object



209
210
211
212
# File 'lib/tkextlib/tcllib/plotchart.rb', line 209

def yticklines(color=None)
  tk_call(@chart, 'yticklines', color)
  self
end